OLD | NEW |
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 #include "components/content_settings/core/browser/cookie_settings.h" | 125 #include "components/content_settings/core/browser/cookie_settings.h" |
126 #include "components/content_settings/core/browser/host_content_settings_map.h" | 126 #include "components/content_settings/core/browser/host_content_settings_map.h" |
127 #include "components/content_settings/core/common/content_settings.h" | 127 #include "components/content_settings/core/common/content_settings.h" |
128 #include "components/content_settings/core/common/content_settings_types.h" | 128 #include "components/content_settings/core/common/content_settings_types.h" |
129 #include "components/dom_distiller/core/dom_distiller_switches.h" | 129 #include "components/dom_distiller/core/dom_distiller_switches.h" |
130 #include "components/dom_distiller/core/url_constants.h" | 130 #include "components/dom_distiller/core/url_constants.h" |
131 #include "components/error_page/common/error_page_switches.h" | 131 #include "components/error_page/common/error_page_switches.h" |
132 #include "components/google/core/browser/google_util.h" | 132 #include "components/google/core/browser/google_util.h" |
133 #include "components/metrics/call_stack_profile_collector.h" | 133 #include "components/metrics/call_stack_profile_collector.h" |
134 #include "components/metrics/client_info.h" | 134 #include "components/metrics/client_info.h" |
| 135 #include "components/nacl/common/nacl_constants.h" |
135 #include "components/net_log/chrome_net_log.h" | 136 #include "components/net_log/chrome_net_log.h" |
136 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 137 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
137 #include "components/payments/payment_request.mojom.h" | 138 #include "components/payments/payment_request.mojom.h" |
138 #include "components/pref_registry/pref_registry_syncable.h" | 139 #include "components/pref_registry/pref_registry_syncable.h" |
139 #include "components/prefs/pref_service.h" | 140 #include "components/prefs/pref_service.h" |
140 #include "components/prefs/scoped_user_pref_update.h" | 141 #include "components/prefs/scoped_user_pref_update.h" |
141 #include "components/rappor/public/rappor_utils.h" | 142 #include "components/rappor/public/rappor_utils.h" |
142 #include "components/rappor/rappor_recorder_impl.h" | 143 #include "components/rappor/rappor_recorder_impl.h" |
143 #include "components/rappor/rappor_service_impl.h" | 144 #include "components/rappor/rappor_service_impl.h" |
144 #include "components/security_interstitials/core/ssl_error_ui.h" | 145 #include "components/security_interstitials/core/ssl_error_ui.h" |
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 OutOfProcessServiceMap* services) { | 3098 OutOfProcessServiceMap* services) { |
3098 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | 3099 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) |
3099 services->insert(std::make_pair("media", | 3100 services->insert(std::make_pair("media", |
3100 base::ASCIIToUTF16("Media Service"))); | 3101 base::ASCIIToUTF16("Media Service"))); |
3101 #endif | 3102 #endif |
3102 services->insert(std::make_pair(image_decoder::mojom::kServiceName, | 3103 services->insert(std::make_pair(image_decoder::mojom::kServiceName, |
3103 base::ASCIIToUTF16("Image Decoder Service"))); | 3104 base::ASCIIToUTF16("Image Decoder Service"))); |
3104 } | 3105 } |
3105 | 3106 |
3106 std::unique_ptr<base::Value> | 3107 std::unique_ptr<base::Value> |
3107 ChromeContentBrowserClient::GetServiceManifestOverlay( | 3108 ChromeContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { |
3108 const std::string& name) { | |
3109 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 3109 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
3110 int id = -1; | 3110 int id = -1; |
3111 if (name == content::mojom::kBrowserServiceName) | 3111 if (name == content::mojom::kBrowserServiceName) |
3112 id = IDR_CHROME_CONTENT_BROWSER_MANIFEST_OVERLAY; | 3112 id = IDR_CHROME_CONTENT_BROWSER_MANIFEST_OVERLAY; |
3113 else if (name == content::mojom::kGpuServiceName) | 3113 else if (name == content::mojom::kGpuServiceName) |
3114 id = IDR_CHROME_CONTENT_GPU_MANIFEST_OVERLAY; | 3114 id = IDR_CHROME_CONTENT_GPU_MANIFEST_OVERLAY; |
3115 else if (name == content::mojom::kPluginServiceName) | 3115 else if (name == content::mojom::kPluginServiceName) |
3116 id = IDR_CHROME_CONTENT_PLUGIN_MANIFEST_OVERLAY; | 3116 id = IDR_CHROME_CONTENT_PLUGIN_MANIFEST_OVERLAY; |
3117 else if (name == content::mojom::kRendererServiceName) | 3117 else if (name == content::mojom::kRendererServiceName) |
3118 id = IDR_CHROME_CONTENT_RENDERER_MANIFEST_OVERLAY; | 3118 id = IDR_CHROME_CONTENT_RENDERER_MANIFEST_OVERLAY; |
3119 else if (name == content::mojom::kUtilityServiceName) | 3119 else if (name == content::mojom::kUtilityServiceName) |
3120 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY; | 3120 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY; |
3121 if (id == -1) | 3121 if (id == -1) |
3122 return nullptr; | 3122 return nullptr; |
3123 | 3123 |
3124 base::StringPiece manifest_contents = | 3124 base::StringPiece manifest_contents = |
3125 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 3125 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
3126 return base::JSONReader::Read(manifest_contents); | 3126 return base::JSONReader::Read(manifest_contents); |
3127 } | 3127 } |
3128 | 3128 |
| 3129 std::vector<content::ContentBrowserClient::ServiceManifestInfo> |
| 3130 ChromeContentBrowserClient::GetExtraServiceManifests() { |
| 3131 return std::vector<content::ContentBrowserClient::ServiceManifestInfo>({ |
| 3132 #if !defined(DISABLE_NACL) |
| 3133 {nacl::kNaClLoaderServiceName, IDR_NACL_LOADER_MANIFEST}, |
| 3134 #if defined(OS_WIN) |
| 3135 {nacl::kNaClBrokerServiceName, IDR_NACL_BROKER_MANIFEST}, |
| 3136 #endif // defined(OS_WIN) |
| 3137 #endif // !defined(DISABLE_NACL) |
| 3138 }); |
| 3139 } |
| 3140 |
3129 void ChromeContentBrowserClient::OpenURL( | 3141 void ChromeContentBrowserClient::OpenURL( |
3130 content::BrowserContext* browser_context, | 3142 content::BrowserContext* browser_context, |
3131 const content::OpenURLParams& params, | 3143 const content::OpenURLParams& params, |
3132 const base::Callback<void(content::WebContents*)>& callback) { | 3144 const base::Callback<void(content::WebContents*)>& callback) { |
3133 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 3145 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
3134 | 3146 |
3135 #if BUILDFLAG(ANDROID_JAVA_UI) | 3147 #if BUILDFLAG(ANDROID_JAVA_UI) |
3136 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, | 3148 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, |
3137 callback); | 3149 callback); |
3138 #else | 3150 #else |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3374 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3386 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3375 return variations::GetVariationParamValue( | 3387 return variations::GetVariationParamValue( |
3376 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3388 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3377 } | 3389 } |
3378 | 3390 |
3379 // static | 3391 // static |
3380 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3392 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3381 const storage::QuotaSettings* settings) { | 3393 const storage::QuotaSettings* settings) { |
3382 g_default_quota_settings = settings; | 3394 g_default_quota_settings = settings; |
3383 } | 3395 } |
OLD | NEW |