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

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

Issue 437503004: Add NaCl support to app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (nacl-init) rebase 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/browser/DEPS ('k') | extensions/shell/browser/shell_content_browser_client.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"
(...skipping 13 matching lines...) Expand all
24 #include "extensions/shell/common/switches.h" 24 #include "extensions/shell/common/switches.h"
25 #include "ui/aura/window_tree_host.h" 25 #include "ui/aura/window_tree_host.h"
26 #include "ui/base/ime/input_method_initializer.h" 26 #include "ui/base/ime/input_method_initializer.h"
27 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
28 28
29 #if defined(OS_CHROMEOS) 29 #if defined(OS_CHROMEOS)
30 #include "chromeos/dbus/dbus_thread_manager.h" 30 #include "chromeos/dbus/dbus_thread_manager.h"
31 #include "extensions/shell/browser/shell_network_controller_chromeos.h" 31 #include "extensions/shell/browser/shell_network_controller_chromeos.h"
32 #endif 32 #endif
33 33
34 #if !defined(DISABLE_NACL)
35 #include "components/nacl/browser/nacl_browser.h"
36 #include "components/nacl/browser/nacl_process_host.h"
37 #include "content/public/browser/browser_thread.h"
38 #include "extensions/shell/browser/shell_nacl_browser_delegate.h"
39 #endif
40
34 using content::BrowserContext; 41 using content::BrowserContext;
35 42
36 namespace { 43 namespace {
37 44
38 // Register additional KeyedService factories here. See 45 // Register additional KeyedService factories here. See
39 // ChromeBrowserMainExtraPartsProfiles for details. 46 // ChromeBrowserMainExtraPartsProfiles for details.
40 void EnsureBrowserContextKeyedServiceFactoriesBuilt() { 47 void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
41 extensions::EnsureBrowserContextKeyedServiceFactoriesBuilt(); 48 extensions::EnsureBrowserContextKeyedServiceFactoriesBuilt();
42 extensions::ShellExtensionSystemFactory::GetInstance(); 49 extensions::ShellExtensionSystemFactory::GetInstance();
43 } 50 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 115
109 // Create our custom ExtensionSystem first because other 116 // Create our custom ExtensionSystem first because other
110 // KeyedServices depend on it. 117 // KeyedServices depend on it.
111 // TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt. 118 // TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt.
112 CreateExtensionSystem(); 119 CreateExtensionSystem();
113 120
114 ::EnsureBrowserContextKeyedServiceFactoriesBuilt(); 121 ::EnsureBrowserContextKeyedServiceFactoriesBuilt();
115 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( 122 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
116 browser_context_.get()); 123 browser_context_.get());
117 124
125 #if !defined(DISABLE_NACL)
126 // Takes ownership.
127 nacl::NaClBrowser::SetDelegate(
128 new ShellNaClBrowserDelegate(browser_context_.get()));
129 content::BrowserThread::PostTask(
130 content::BrowserThread::IO,
131 FROM_HERE,
132 base::Bind(nacl::NaClProcessHost::EarlyStartup));
133 #endif
134
118 devtools_delegate_.reset( 135 devtools_delegate_.reset(
119 new content::ShellDevToolsDelegate(browser_context_.get())); 136 new content::ShellDevToolsDelegate(browser_context_.get()));
120 if (parameters_.ui_task) { 137 if (parameters_.ui_task) {
121 // For running browser tests. 138 // For running browser tests.
122 parameters_.ui_task->Run(); 139 parameters_.ui_task->Run();
123 delete parameters_.ui_task; 140 delete parameters_.ui_task;
124 run_message_loop_ = false; 141 run_message_loop_ = false;
125 } else { 142 } else {
126 browser_main_delegate_->Start(browser_context_.get()); 143 browser_main_delegate_->Start(browser_context_.get());
127 } 144 }
(...skipping 30 matching lines...) Expand all
158 } 175 }
159 176
160 void ShellBrowserMainParts::CreateExtensionSystem() { 177 void ShellBrowserMainParts::CreateExtensionSystem() {
161 DCHECK(browser_context_); 178 DCHECK(browser_context_);
162 extension_system_ = static_cast<ShellExtensionSystem*>( 179 extension_system_ = static_cast<ShellExtensionSystem*>(
163 ExtensionSystem::Get(browser_context_.get())); 180 ExtensionSystem::Get(browser_context_.get()));
164 extension_system_->InitForRegularProfile(true); 181 extension_system_->InitForRegularProfile(true);
165 } 182 }
166 183
167 } // namespace extensions 184 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/DEPS ('k') | extensions/shell/browser/shell_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698