| 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> |
| 11 | 11 |
| 12 #include "base/base_switches.h" | 12 #include "base/base_switches.h" |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/files/scoped_file.h" | 16 #include "base/files/scoped_file.h" |
| 17 #include "base/json/json_reader.h" | |
| 18 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
| 19 #include "base/macros.h" | 18 #include "base/macros.h" |
| 20 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 21 #include "base/metrics/histogram_macros.h" | 20 #include "base/metrics/histogram_macros.h" |
| 22 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| 23 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 26 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #include "chrome/common/chrome_paths.h" | 99 #include "chrome/common/chrome_paths.h" |
| 101 #include "chrome/common/chrome_switches.h" | 100 #include "chrome/common/chrome_switches.h" |
| 102 #include "chrome/common/env_vars.h" | 101 #include "chrome/common/env_vars.h" |
| 103 #include "chrome/common/features.h" | 102 #include "chrome/common/features.h" |
| 104 #include "chrome/common/logging_chrome.h" | 103 #include "chrome/common/logging_chrome.h" |
| 105 #include "chrome/common/pepper_permission_util.h" | 104 #include "chrome/common/pepper_permission_util.h" |
| 106 #include "chrome/common/pref_names.h" | 105 #include "chrome/common/pref_names.h" |
| 107 #include "chrome/common/render_messages.h" | 106 #include "chrome/common/render_messages.h" |
| 108 #include "chrome/common/secure_origin_whitelist.h" | 107 #include "chrome/common/secure_origin_whitelist.h" |
| 109 #include "chrome/common/url_constants.h" | 108 #include "chrome/common/url_constants.h" |
| 110 #include "chrome/grit/browser_resources.h" | |
| 111 #include "chrome/grit/generated_resources.h" | 109 #include "chrome/grit/generated_resources.h" |
| 112 #include "chrome/installer/util/google_update_settings.h" | 110 #include "chrome/installer/util/google_update_settings.h" |
| 113 #include "chromeos/chromeos_constants.h" | 111 #include "chromeos/chromeos_constants.h" |
| 114 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 112 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
| 115 #include "components/autofill/core/common/autofill_switches.h" | 113 #include "components/autofill/core/common/autofill_switches.h" |
| 116 #include "components/cdm/browser/cdm_message_filter_android.h" | 114 #include "components/cdm/browser/cdm_message_filter_android.h" |
| 117 #include "components/cloud_devices/common/cloud_devices_switches.h" | 115 #include "components/cloud_devices/common/cloud_devices_switches.h" |
| 118 #include "components/content_settings/core/browser/content_settings_utils.h" | 116 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 119 #include "components/content_settings/core/browser/cookie_settings.h" | 117 #include "components/content_settings/core/browser/cookie_settings.h" |
| 120 #include "components/content_settings/core/browser/host_content_settings_map.h" | 118 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 #include "content/public/browser/site_instance.h" | 155 #include "content/public/browser/site_instance.h" |
| 158 #include "content/public/browser/storage_partition.h" | 156 #include "content/public/browser/storage_partition.h" |
| 159 #include "content/public/browser/vpn_service_proxy.h" | 157 #include "content/public/browser/vpn_service_proxy.h" |
| 160 #include "content/public/browser/web_contents.h" | 158 #include "content/public/browser/web_contents.h" |
| 161 #include "content/public/common/child_process_host.h" | 159 #include "content/public/common/child_process_host.h" |
| 162 #include "content/public/common/content_descriptors.h" | 160 #include "content/public/common/content_descriptors.h" |
| 163 #include "content/public/common/content_features.h" | 161 #include "content/public/common/content_features.h" |
| 164 #include "content/public/common/content_switches.h" | 162 #include "content/public/common/content_switches.h" |
| 165 #include "content/public/common/mojo_shell_connection.h" | 163 #include "content/public/common/mojo_shell_connection.h" |
| 166 #include "content/public/common/sandbox_type.h" | 164 #include "content/public/common/sandbox_type.h" |
| 167 #include "content/public/common/service_names.h" | |
| 168 #include "content/public/common/url_utils.h" | 165 #include "content/public/common/url_utils.h" |
| 169 #include "content/public/common/web_preferences.h" | 166 #include "content/public/common/web_preferences.h" |
| 170 #include "device/usb/public/interfaces/chooser_service.mojom.h" | 167 #include "device/usb/public/interfaces/chooser_service.mojom.h" |
| 171 #include "device/usb/public/interfaces/device_manager.mojom.h" | 168 #include "device/usb/public/interfaces/device_manager.mojom.h" |
| 172 #include "gin/v8_initializer.h" | 169 #include "gin/v8_initializer.h" |
| 173 #include "net/base/mime_util.h" | 170 #include "net/base/mime_util.h" |
| 174 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 171 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 175 #include "net/cookies/canonical_cookie.h" | 172 #include "net/cookies/canonical_cookie.h" |
| 176 #include "net/cookies/cookie_options.h" | 173 #include "net/cookies/cookie_options.h" |
| 177 #include "net/ssl/ssl_cert_request_info.h" | 174 #include "net/ssl/ssl_cert_request_info.h" |
| (...skipping 2782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2960 } | 2957 } |
| 2961 | 2958 |
| 2962 void ChromeContentBrowserClient::RegisterOutOfProcessMojoApplications( | 2959 void ChromeContentBrowserClient::RegisterOutOfProcessMojoApplications( |
| 2963 OutOfProcessMojoApplicationMap* apps) { | 2960 OutOfProcessMojoApplicationMap* apps) { |
| 2964 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | 2961 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) |
| 2965 apps->insert(std::make_pair("mojo:media", | 2962 apps->insert(std::make_pair("mojo:media", |
| 2966 base::ASCIIToUTF16("Media App"))); | 2963 base::ASCIIToUTF16("Media App"))); |
| 2967 #endif | 2964 #endif |
| 2968 } | 2965 } |
| 2969 | 2966 |
| 2970 std::unique_ptr<base::Value> | |
| 2971 ChromeContentBrowserClient::GetServiceManifestOverlay( | |
| 2972 const std::string& name) { | |
| 2973 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | |
| 2974 int id = -1; | |
| 2975 if (name == content::kBrowserMojoApplicationName) | |
| 2976 id = IDR_CONTENT_BROWSER_MANIFEST_OVERLAY; | |
| 2977 if (id == -1) | |
| 2978 return nullptr; | |
| 2979 | |
| 2980 base::StringPiece manifest_contents = | |
| 2981 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | |
| 2982 return base::JSONReader::Read(manifest_contents); | |
| 2983 } | |
| 2984 | |
| 2985 void ChromeContentBrowserClient::OpenURL( | 2967 void ChromeContentBrowserClient::OpenURL( |
| 2986 content::BrowserContext* browser_context, | 2968 content::BrowserContext* browser_context, |
| 2987 const content::OpenURLParams& params, | 2969 const content::OpenURLParams& params, |
| 2988 const base::Callback<void(content::WebContents*)>& callback) { | 2970 const base::Callback<void(content::WebContents*)>& callback) { |
| 2989 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2971 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 2990 | 2972 |
| 2991 #if BUILDFLAG(ANDROID_JAVA_UI) | 2973 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 2992 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, | 2974 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, |
| 2993 callback); | 2975 callback); |
| 2994 #else | 2976 #else |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3186 if (channel <= kMaxDisableEncryptionChannel) { | 3168 if (channel <= kMaxDisableEncryptionChannel) { |
| 3187 static const char* const kWebRtcDevSwitchNames[] = { | 3169 static const char* const kWebRtcDevSwitchNames[] = { |
| 3188 switches::kDisableWebRtcEncryption, | 3170 switches::kDisableWebRtcEncryption, |
| 3189 }; | 3171 }; |
| 3190 to_command_line->CopySwitchesFrom(from_command_line, | 3172 to_command_line->CopySwitchesFrom(from_command_line, |
| 3191 kWebRtcDevSwitchNames, | 3173 kWebRtcDevSwitchNames, |
| 3192 arraysize(kWebRtcDevSwitchNames)); | 3174 arraysize(kWebRtcDevSwitchNames)); |
| 3193 } | 3175 } |
| 3194 } | 3176 } |
| 3195 #endif // defined(ENABLE_WEBRTC) | 3177 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |