Chromium Code Reviews| 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 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3119 else if (name == content::mojom::kUtilityServiceName) | 3120 else if (name == content::mojom::kUtilityServiceName) |
| 3120 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY; | 3121 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY; |
| 3121 if (id == -1) | 3122 if (id == -1) |
| 3122 return nullptr; | 3123 return nullptr; |
| 3123 | 3124 |
| 3124 base::StringPiece manifest_contents = | 3125 base::StringPiece manifest_contents = |
| 3125 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 3126 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
| 3126 return base::JSONReader::Read(manifest_contents); | 3127 return base::JSONReader::Read(manifest_contents); |
| 3127 } | 3128 } |
| 3128 | 3129 |
| 3130 std::vector<content::ContentBrowserClient::ServiceManifestInfo> | |
| 3131 ChromeContentBrowserClient::GetExtraServiceManifests() { | |
| 3132 return std::vector<content::ContentBrowserClient::ServiceManifestInfo>({ | |
| 3133 #if !defined(DISABLE_NACL) | |
| 3134 {nacl::kNaClLoaderServiceName, IDR_NACL_LOADER_MANIFEST}, | |
| 3135 #if defined(OS_WIN) | |
| 3136 {nacl::kNaClBrokerServiceName, IDR_NACL_BROKER_MANIFEST}, | |
|
dcheng
2016/12/19 05:03:25
If this is something clang-format is doing, do you
Sam McNally
2016/12/19 09:36:18
https://bugs.chromium.org/p/chromium/issues/detail
| |
| 3137 #endif // defined(OS_WIN) | |
| 3138 #endif // !defined(DISABLE_NACL) | |
| 3139 }); | |
| 3140 } | |
| 3141 | |
| 3129 void ChromeContentBrowserClient::OpenURL( | 3142 void ChromeContentBrowserClient::OpenURL( |
| 3130 content::BrowserContext* browser_context, | 3143 content::BrowserContext* browser_context, |
| 3131 const content::OpenURLParams& params, | 3144 const content::OpenURLParams& params, |
| 3132 const base::Callback<void(content::WebContents*)>& callback) { | 3145 const base::Callback<void(content::WebContents*)>& callback) { |
| 3133 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 3146 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 3134 | 3147 |
| 3135 #if BUILDFLAG(ANDROID_JAVA_UI) | 3148 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 3136 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, | 3149 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, |
| 3137 callback); | 3150 callback); |
| 3138 #else | 3151 #else |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3374 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3387 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3375 return variations::GetVariationParamValue( | 3388 return variations::GetVariationParamValue( |
| 3376 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3389 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3377 } | 3390 } |
| 3378 | 3391 |
| 3379 // static | 3392 // static |
| 3380 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3393 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3381 const storage::QuotaSettings* settings) { | 3394 const storage::QuotaSettings* settings) { |
| 3382 g_default_quota_settings = settings; | 3395 g_default_quota_settings = settings; |
| 3383 } | 3396 } |
| OLD | NEW |