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

Side by Side Diff: extensions/shell/browser/shell_browser_main_parts.cc

Issue 468393005: app_shell: Shut down in response to power button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/shell/app_shell.gyp ('k') | extensions/shell/browser/shell_desktop_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/shell_browser_main_parts.h" 5 #include "extensions/shell/browser/shell_browser_main_parts.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "components/omaha_query_params/omaha_query_params.h" 10 #include "components/omaha_query_params/omaha_query_params.h"
11 #include "content/public/browser/context_factory.h"
11 #include "content/public/common/result_codes.h" 12 #include "content/public/common/result_codes.h"
12 #include "content/shell/browser/shell_devtools_delegate.h" 13 #include "content/shell/browser/shell_devtools_delegate.h"
13 #include "content/shell/browser/shell_net_log.h" 14 #include "content/shell/browser/shell_net_log.h"
14 #include "extensions/browser/browser_context_keyed_service_factories.h" 15 #include "extensions/browser/browser_context_keyed_service_factories.h"
15 #include "extensions/browser/extension_system.h" 16 #include "extensions/browser/extension_system.h"
16 #include "extensions/shell/browser/shell_browser_context.h" 17 #include "extensions/shell/browser/shell_browser_context.h"
17 #include "extensions/shell/browser/shell_browser_main_delegate.h" 18 #include "extensions/shell/browser/shell_browser_main_delegate.h"
18 #include "extensions/shell/browser/shell_desktop_controller.h" 19 #include "extensions/shell/browser/shell_desktop_controller.h"
19 #include "extensions/shell/browser/shell_extension_system.h" 20 #include "extensions/shell/browser/shell_extension_system.h"
20 #include "extensions/shell/browser/shell_extension_system_factory.h" 21 #include "extensions/shell/browser/shell_extension_system_factory.h"
21 #include "extensions/shell/browser/shell_extensions_browser_client.h" 22 #include "extensions/shell/browser/shell_extensions_browser_client.h"
22 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" 23 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h"
23 #include "extensions/shell/common/shell_extensions_client.h" 24 #include "extensions/shell/common/shell_extensions_client.h"
24 #include "extensions/shell/common/switches.h" 25 #include "extensions/shell/common/switches.h"
26 #include "ui/aura/env.h"
25 #include "ui/aura/window_tree_host.h" 27 #include "ui/aura/window_tree_host.h"
26 #include "ui/base/ime/input_method_initializer.h" 28 #include "ui/base/ime/input_method_initializer.h"
27 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
28 30
29 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
30 #include "chromeos/dbus/dbus_thread_manager.h" 32 #include "chromeos/dbus/dbus_thread_manager.h"
31 #include "extensions/shell/browser/shell_network_controller_chromeos.h" 33 #include "extensions/shell/browser/shell_network_controller_chromeos.h"
32 #endif 34 #endif
33 35
34 #if !defined(DISABLE_NACL) 36 #if !defined(DISABLE_NACL)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // TODO(jamescook): Initialize chromeos::CrosSettings here? 90 // TODO(jamescook): Initialize chromeos::CrosSettings here?
89 91
90 // Return no error. 92 // Return no error.
91 return 0; 93 return 0;
92 } 94 }
93 95
94 void ShellBrowserMainParts::PreMainMessageLoopRun() { 96 void ShellBrowserMainParts::PreMainMessageLoopRun() {
95 // Initialize our "profile" equivalent. 97 // Initialize our "profile" equivalent.
96 browser_context_.reset(new ShellBrowserContext); 98 browser_context_.reset(new ShellBrowserContext);
97 99
100 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory());
101
98 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); 102 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController());
99 desktop_controller_->CreateRootWindow();
100 103
101 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc 104 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc
102 // TODO(jamescook): Initialize user_manager::UserManager. 105 // TODO(jamescook): Initialize user_manager::UserManager.
103 net_log_.reset(new content::ShellNetLog("app_shell")); 106 net_log_.reset(new content::ShellNetLog("app_shell"));
104 107
105 extensions_client_.reset(new ShellExtensionsClient()); 108 extensions_client_.reset(new ShellExtensionsClient());
106 ExtensionsClient::Set(extensions_client_.get()); 109 ExtensionsClient::Set(extensions_client_.get());
107 110
108 extensions_browser_client_.reset( 111 extensions_browser_client_.reset(
109 new ShellExtensionsBrowserClient(browser_context_.get())); 112 new ShellExtensionsBrowserClient(browser_context_.get()));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 178 }
176 179
177 void ShellBrowserMainParts::CreateExtensionSystem() { 180 void ShellBrowserMainParts::CreateExtensionSystem() {
178 DCHECK(browser_context_); 181 DCHECK(browser_context_);
179 extension_system_ = static_cast<ShellExtensionSystem*>( 182 extension_system_ = static_cast<ShellExtensionSystem*>(
180 ExtensionSystem::Get(browser_context_.get())); 183 ExtensionSystem::Get(browser_context_.get()));
181 extension_system_->InitForRegularProfile(true); 184 extension_system_->InitForRegularProfile(true);
182 } 185 }
183 186
184 } // namespace extensions 187 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/app_shell.gyp ('k') | extensions/shell/browser/shell_desktop_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698