This commit migrates below EWK_BRINGUP removal patches.
Remove EWK_BRINGUP in browser_context_efl.cc
Remove EWK_BRINGUP in ContentBrowserClientEfl::CanCreateWindow
Remove EWK_BRINGUP from DownloadManagerDelegateEfl
Reference: https://review.tizen.org/gerrit/c/281750
Change-Id: I0b66de521d2b16c995af8920d8aef1a5db647430
Signed-off-by: Bakka Uday Kiran <b.kiran@samsung.com>
autofill::AutocompleteHistoryManagerFactoryEfl::GetInstance()
->AutocompleteHistoryManagerAdd(this);
#endif
-#if !defined(EWK_BRINGUP) // FIXME: m85 bringup
- BrowserContext::Initialize(this, GetPath());
-#endif
}
std::unique_ptr<ZoomLevelDelegate> BrowserContextEfl::CreateZoomLevelDelegate(
return GetResourceContextEfl();
}
+DownloadManagerDelegate* BrowserContextEfl::GetDownloadManagerDelegate() {
+ if (!download_manager_delegate_.get()) {
+ download_manager_delegate_ =
+ std::make_unique<DownloadManagerDelegateEfl>(GetDownloadManager());
+ }
+ return download_manager_delegate_.get();
+}
+
BrowserContextEfl::ResourceContextEfl*
BrowserContextEfl::GetResourceContextEfl() {
if (!resource_context_) {
return nullptr;
}
ResourceContext* GetResourceContext() override;
- content::DownloadManagerDelegate* GetDownloadManagerDelegate() override {
- return &download_manager_delegate_;
- }
+ DownloadManagerDelegate* GetDownloadManagerDelegate() override;
BrowserPluginGuestManager* GetGuestManager() override { return 0; }
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override {
return GetSpecialStoragePolicyEfl();
std::unique_ptr<visitedlink::VisitedLinkWriter> visitedlink_writer_;
ResourceContextEfl* resource_context_;
EWebContext* web_context_;
- DownloadManagerDelegateEfl download_manager_delegate_;
+ std::unique_ptr<DownloadManagerDelegateEfl> download_manager_delegate_;
base::ScopedTempDir temp_dir_;
bool temp_dir_creation_attempted_;
std::unique_ptr<PrefService> user_pref_service_;
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) {
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
if (!user_gesture) {
*no_javascript_access = true;
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::BindOnce(&DispatchPopupBlockedOnUIThread,
- render_process_id, target_url));
+ base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI},
+ base::BindOnce(&DispatchPopupBlockedOnUIThread,
+ opener->GetProcess()->GetID(), target_url));
return false;
}
-#endif
// User_gesture is modified on renderer side to true if javascript
// is allowed to open windows without user gesture. If we've got user gesture
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "content/common/paths_efl.h"
+#include "content/public/browser/download_manager.h"
#include "ewk/efl_integration/browser_context_efl.h"
#include "ewk/efl_integration/eweb_view.h"
#include "third_party/blink/public/common/mime_util/mime_util.h"
+DownloadManagerDelegateEfl::DownloadManagerDelegateEfl(
+ content::DownloadManager* download_manager)
+ : download_manager_(download_manager) {}
+
+DownloadManagerDelegateEfl::~DownloadManagerDelegateEfl() {
+ if (download_manager_) {
+ DCHECK_EQ(static_cast<content::DownloadManagerDelegate*>(this),
+ download_manager_->GetDelegate());
+ download_manager_->SetDelegate(nullptr);
+ download_manager_ = nullptr;
+ }
+}
+
bool DownloadManagerDelegateEfl::TriggerExternalDownloadManager(
download::DownloadItem* item) const {
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- content::BrowserContextEfl* browser_context =
- static_cast<content::BrowserContextEfl*>(item->GetBrowserContext());
-#else
- content::BrowserContextEfl* browser_context = nullptr;
-#endif
- if (browser_context) {
- auto start_download_callback =
- browser_context->WebContext()->DidStartDownloadCallback();
- if (start_download_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- start_download_callback->TriggerCallback(item->GetURL().spec());
- return true;
- }
- }
- return false;
+ auto* browser_context = static_cast<content::BrowserContextEfl*>(
+ download_manager_->GetBrowserContext());
+ return browser_context
+ ? browser_context->WebContext()->TriggerDidStartDownloadCallback(
+ item->GetURL().spec())
+ : false;
}
base::FilePath DownloadManagerDelegateEfl::GetPlatformDownloadPath(
#include "content/public/browser/download_manager_delegate.h"
+namespace content {
+class DownloadManager;
+}
+
// This is the EFL side helper for the download system.
class DownloadManagerDelegateEfl : public content::DownloadManagerDelegate {
public:
- ~DownloadManagerDelegateEfl() override = default;
+ explicit DownloadManagerDelegateEfl(
+ content::DownloadManager* download_manager);
+
+ DownloadManagerDelegateEfl(const DownloadManagerDelegateEfl&) = delete;
+ DownloadManagerDelegateEfl& operator=(const DownloadManagerDelegateEfl&) = delete;
+
+ ~DownloadManagerDelegateEfl() override;
// content::DownloadManagerDelegate implementation.
bool DetermineDownloadTarget(download::DownloadItem*,
void GetNextId(content::DownloadIdCallback) override;
private:
- // If the external download manager is available, trigger download
- // with it and return true, otherwise return false.
+ // If the external download manager is available, trigger download
+ // with it and return true, otherwise return false.
bool TriggerExternalDownloadManager(download::DownloadItem* item) const;
base::FilePath GetPlatformDownloadPath(download::DownloadItem* item) const;
+
+ content::DownloadManager* download_manager_;
};
#endif // DOWNLOAD_MANAGER_DELEGATE_EFL_H
new EwkDidStartDownloadCallback(callback, user_data));
}
+bool EWebContext::TriggerDidStartDownloadCallback(const std::string& url) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!start_download_callback_)
+ return false;
+
+ start_download_callback_->TriggerCallback(url);
+ return true;
+}
+
EwkDidStartDownloadCallback* EWebContext::DidStartDownloadCallback() {
return start_download_callback_.get();
}
//download start callback handlers
void SetDidStartDownloadCallback(Ewk_Context_Did_Start_Download_Callback callback,
void* user_data);
+ bool TriggerDidStartDownloadCallback(const std::string& url);
EwkDidStartDownloadCallback* DidStartDownloadCallback();
void DeleteAllApplicationCache();
void DeleteApplicationCacheForSite(const GURL&);