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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2501913002: Change the NaCl loader and broker processes to use the ServiceManager. (Closed)
Patch Set: rebase Created 4 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 #include "components/content_settings/core/browser/cookie_settings.h" 127 #include "components/content_settings/core/browser/cookie_settings.h"
128 #include "components/content_settings/core/browser/host_content_settings_map.h" 128 #include "components/content_settings/core/browser/host_content_settings_map.h"
129 #include "components/content_settings/core/common/content_settings.h" 129 #include "components/content_settings/core/common/content_settings.h"
130 #include "components/content_settings/core/common/content_settings_types.h" 130 #include "components/content_settings/core/common/content_settings_types.h"
131 #include "components/dom_distiller/core/dom_distiller_switches.h" 131 #include "components/dom_distiller/core/dom_distiller_switches.h"
132 #include "components/dom_distiller/core/url_constants.h" 132 #include "components/dom_distiller/core/url_constants.h"
133 #include "components/error_page/common/error_page_switches.h" 133 #include "components/error_page/common/error_page_switches.h"
134 #include "components/google/core/browser/google_util.h" 134 #include "components/google/core/browser/google_util.h"
135 #include "components/metrics/call_stack_profile_collector.h" 135 #include "components/metrics/call_stack_profile_collector.h"
136 #include "components/metrics/client_info.h" 136 #include "components/metrics/client_info.h"
137 #include "components/nacl/common/nacl_constants.h"
137 #include "components/net_log/chrome_net_log.h" 138 #include "components/net_log/chrome_net_log.h"
138 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h" 139 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h"
139 #include "components/payments/payment_request.mojom.h" 140 #include "components/payments/payment_request.mojom.h"
140 #include "components/pref_registry/pref_registry_syncable.h" 141 #include "components/pref_registry/pref_registry_syncable.h"
141 #include "components/prefs/pref_service.h" 142 #include "components/prefs/pref_service.h"
142 #include "components/prefs/scoped_user_pref_update.h" 143 #include "components/prefs/scoped_user_pref_update.h"
143 #include "components/rappor/public/rappor_utils.h" 144 #include "components/rappor/public/rappor_utils.h"
144 #include "components/rappor/rappor_recorder_impl.h" 145 #include "components/rappor/rappor_recorder_impl.h"
145 #include "components/rappor/rappor_service_impl.h" 146 #include "components/rappor/rappor_service_impl.h"
146 #include "components/security_interstitials/core/ssl_error_ui.h" 147 #include "components/security_interstitials/core/ssl_error_ui.h"
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
3088 OutOfProcessServiceMap* services) { 3089 OutOfProcessServiceMap* services) {
3089 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) 3090 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
3090 services->insert(std::make_pair("media", 3091 services->insert(std::make_pair("media",
3091 base::ASCIIToUTF16("Media Service"))); 3092 base::ASCIIToUTF16("Media Service")));
3092 #endif 3093 #endif
3093 services->insert(std::make_pair(image_decoder::mojom::kServiceName, 3094 services->insert(std::make_pair(image_decoder::mojom::kServiceName,
3094 base::ASCIIToUTF16("Image Decoder Service"))); 3095 base::ASCIIToUTF16("Image Decoder Service")));
3095 } 3096 }
3096 3097
3097 std::unique_ptr<base::Value> 3098 std::unique_ptr<base::Value>
3098 ChromeContentBrowserClient::GetServiceManifestOverlay( 3099 ChromeContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
3099 const std::string& name) {
3100 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 3100 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
3101 int id = -1; 3101 int id = -1;
3102 if (name == content::mojom::kBrowserServiceName) 3102 if (name == content::mojom::kBrowserServiceName)
3103 id = IDR_CHROME_CONTENT_BROWSER_MANIFEST_OVERLAY; 3103 id = IDR_CHROME_CONTENT_BROWSER_MANIFEST_OVERLAY;
3104 else if (name == content::mojom::kGpuServiceName) 3104 else if (name == content::mojom::kGpuServiceName)
3105 id = IDR_CHROME_CONTENT_GPU_MANIFEST_OVERLAY; 3105 id = IDR_CHROME_CONTENT_GPU_MANIFEST_OVERLAY;
3106 else if (name == content::mojom::kPluginServiceName) 3106 else if (name == content::mojom::kPluginServiceName)
3107 id = IDR_CHROME_CONTENT_PLUGIN_MANIFEST_OVERLAY; 3107 id = IDR_CHROME_CONTENT_PLUGIN_MANIFEST_OVERLAY;
3108 else if (name == content::mojom::kRendererServiceName) 3108 else if (name == content::mojom::kRendererServiceName)
3109 id = IDR_CHROME_CONTENT_RENDERER_MANIFEST_OVERLAY; 3109 id = IDR_CHROME_CONTENT_RENDERER_MANIFEST_OVERLAY;
3110 else if (name == content::mojom::kUtilityServiceName) 3110 else if (name == content::mojom::kUtilityServiceName)
3111 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY; 3111 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY;
3112 if (id == -1) 3112 if (id == -1)
3113 return nullptr; 3113 return nullptr;
3114 3114
3115 base::StringPiece manifest_contents = 3115 base::StringPiece manifest_contents =
3116 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); 3116 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE);
3117 return base::JSONReader::Read(manifest_contents); 3117 return base::JSONReader::Read(manifest_contents);
3118 } 3118 }
3119 3119
3120 std::vector<content::ContentBrowserClient::ServiceManifestInfo>
3121 ChromeContentBrowserClient::GetExtraServiceManifests() {
3122 return std::vector<content::ContentBrowserClient::ServiceManifestInfo>({
3123 #if !defined(DISABLE_NACL)
3124 {nacl::kNaClLoaderServiceName, IDR_NACL_LOADER_MANIFEST},
3125 #if defined(OS_WIN)
3126 {nacl::kNaClBrokerServiceName, IDR_NACL_BROKER_MANIFEST},
3127 #endif // defined(OS_WIN)
3128 #endif // !defined(DISABLE_NACL)
3129 });
3130 }
3131
3120 void ChromeContentBrowserClient::OpenURL( 3132 void ChromeContentBrowserClient::OpenURL(
3121 content::BrowserContext* browser_context, 3133 content::BrowserContext* browser_context,
3122 const content::OpenURLParams& params, 3134 const content::OpenURLParams& params,
3123 const base::Callback<void(content::WebContents*)>& callback) { 3135 const base::Callback<void(content::WebContents*)>& callback) {
3124 DCHECK_CURRENTLY_ON(BrowserThread::UI); 3136 DCHECK_CURRENTLY_ON(BrowserThread::UI);
3125 3137
3126 #if BUILDFLAG(ANDROID_JAVA_UI) 3138 #if BUILDFLAG(ANDROID_JAVA_UI)
3127 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, 3139 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params,
3128 callback); 3140 callback);
3129 #else 3141 #else
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { 3376 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() {
3365 return variations::GetVariationParamValue( 3377 return variations::GetVariationParamValue(
3366 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; 3378 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true";
3367 } 3379 }
3368 3380
3369 bool ChromeContentBrowserClient:: 3381 bool ChromeContentBrowserClient::
3370 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3382 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3371 return variations::GetVariationParamValue( 3383 return variations::GetVariationParamValue(
3372 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3384 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3373 } 3385 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/chrome_content_browser_manifest_overlay.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698