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 |