Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: ash/shell/content_client/shell_browser_main_parts.cc

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy ash ViewsDelegate Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/shell/content_client/shell_browser_main_parts.cc
diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc
index a7a7c57d47bfc755d35e09dbb108db0a31e067b5..1845c7629ece1aecd26fb7502689bc5d8833fcd5 100644
--- a/ash/shell/content_client/shell_browser_main_parts.cc
+++ b/ash/shell/content_client/shell_browser_main_parts.cc
@@ -108,8 +108,8 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
false, net_log_.get()));
// A ViewsDelegate is required.
- if (!views::ViewsDelegate::views_delegate)
- views::ViewsDelegate::views_delegate = new ShellViewsDelegate;
+ if (!views::ViewsDelegate::GetInstance())
+ views_delegate_.reset(new ShellViewsDelegate);
delegate_ = new ash::shell::ShellDelegateImpl;
// The global message center state must be initialized absent
@@ -159,6 +159,8 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() {
aura::Env::DeleteInstance();
+ views_delegate_.reset();
+
// The keyboard may have created a WebContents. The WebContents is destroyed
// with the UI, and it needs the BrowserContext to be alive during its
// destruction. So destroy all of the UI elements before destroying the
« no previous file with comments | « ash/shell/content_client/shell_browser_main_parts.h ('k') | chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698