diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/weblayer/shell/app | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/weblayer/shell/app')
-rw-r--r-- | chromium/weblayer/shell/app/shell_main_params.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/chromium/weblayer/shell/app/shell_main_params.cc b/chromium/weblayer/shell/app/shell_main_params.cc index 36e58d734ae..9ece1e23cda 100644 --- a/chromium/weblayer/shell/app/shell_main_params.cc +++ b/chromium/weblayer/shell/app/shell_main_params.cc @@ -49,29 +49,45 @@ GURL GetStartupURL() { class MainDelegateImpl : public MainDelegate { public: void PreMainMessageLoopRun() override { + // On Android the Profile is created and owned in Java via an + // embedder-specific call to WebLayer.createBrowserFragment(). +#if !defined(OS_ANDROID) InitializeProfile(); +#endif Shell::Initialize(); +#if defined(OS_ANDROID) + Shell::CreateNewWindow(GetStartupURL(), gfx::Size()); +#else Shell::CreateNewWindow(profile_.get(), GetStartupURL(), gfx::Size()); +#endif } - void PostMainMessageLoopRun() override { DestroyProfile(); } + void PostMainMessageLoopRun() override { +#if !defined(OS_ANDROID) + DestroyProfile(); +#endif + } void SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure) override { Shell::SetMainMessageLoopQuitClosure(std::move(quit_closure)); } private: +#if !defined(OS_ANDROID) void InitializeProfile() { - profile_ = Profile::Create("web_shell"); + auto* command_line = base::CommandLine::ForCurrentProcess(); + std::string profile_name = + command_line->HasSwitch(switches::kStartInIncognito) ? "" : "web_shell"; - // TODO: create an incognito profile as well. + profile_ = Profile::Create(profile_name); } void DestroyProfile() { profile_.reset(); } std::unique_ptr<Profile> profile_; +#endif }; } // namespace |