| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/shell/browser/shell_browser_main_parts.h" | 5 #include "apps/shell/browser/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "apps/browser_context_keyed_service_factories.h" | 7 #include "apps/browser_context_keyed_service_factories.h" |
| 8 #include "apps/shell/browser/shell_apps_client.h" | 8 #include "apps/shell/browser/shell_apps_client.h" |
| 9 #include "apps/shell/browser/shell_browser_context.h" | 9 #include "apps/shell/browser/shell_browser_context.h" |
| 10 #include "apps/shell/browser/shell_extension_system.h" | 10 #include "apps/shell/browser/shell_extension_system.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 wm_test_helper_->host()->Show(); | 187 wm_test_helper_->host()->Show(); |
| 188 // Watch for the user clicking the close box. | 188 // Watch for the user clicking the close box. |
| 189 wm_test_helper_->host()->AddObserver(this); | 189 wm_test_helper_->host()->AddObserver(this); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void ShellBrowserMainParts::DestroyRootWindow() { | 192 void ShellBrowserMainParts::DestroyRootWindow() { |
| 193 // We should close widget before destroying root window. | 193 // We should close widget before destroying root window. |
| 194 webview_window_.reset(); | 194 webview_window_.reset(); |
| 195 devtools_delegate_->Stop(); | 195 devtools_delegate_->Stop(); |
| 196 wm_test_helper_->host()->RemoveObserver(this); | 196 wm_test_helper_->host()->RemoveObserver(this); |
| 197 wm_test_helper_->host()->dispatcher()->PrepareForShutdown(); | |
| 198 wm_test_helper_.reset(); | 197 wm_test_helper_.reset(); |
| 199 ui::ShutdownInputMethodForTesting(); | 198 ui::ShutdownInputMethodForTesting(); |
| 200 } | 199 } |
| 201 | 200 |
| 202 void ShellBrowserMainParts::CreateViewsDelegate() { | 201 void ShellBrowserMainParts::CreateViewsDelegate() { |
| 203 DCHECK(!views::ViewsDelegate::views_delegate); | 202 DCHECK(!views::ViewsDelegate::views_delegate); |
| 204 views::ViewsDelegate::views_delegate = | 203 views::ViewsDelegate::views_delegate = |
| 205 new ShellViewsDelegate(wm_test_helper_->host()->window()); | 204 new ShellViewsDelegate(wm_test_helper_->host()->window()); |
| 206 } | 205 } |
| 207 | 206 |
| 208 void ShellBrowserMainParts::DestroyViewsDelegate() { | 207 void ShellBrowserMainParts::DestroyViewsDelegate() { |
| 209 delete views::ViewsDelegate::views_delegate; | 208 delete views::ViewsDelegate::views_delegate; |
| 210 views::ViewsDelegate::views_delegate = NULL; | 209 views::ViewsDelegate::views_delegate = NULL; |
| 211 } | 210 } |
| 212 | 211 |
| 213 void ShellBrowserMainParts::CreateExtensionSystem() { | 212 void ShellBrowserMainParts::CreateExtensionSystem() { |
| 214 DCHECK(browser_context_); | 213 DCHECK(browser_context_); |
| 215 extension_system_ = static_cast<ShellExtensionSystem*>( | 214 extension_system_ = static_cast<ShellExtensionSystem*>( |
| 216 ExtensionSystem::Get(browser_context_.get())); | 215 ExtensionSystem::Get(browser_context_.get())); |
| 217 extension_system_->InitForRegularProfile(true); | 216 extension_system_->InitForRegularProfile(true); |
| 218 } | 217 } |
| 219 | 218 |
| 220 } // namespace apps | 219 } // namespace apps |
| OLD | NEW |