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" | |
17 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
18 #include "base/macros.h" | 19 #include "base/macros.h" |
19 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
20 #include "base/metrics/histogram_macros.h" | 21 #include "base/metrics/histogram_macros.h" |
21 #include "base/path_service.h" | 22 #include "base/path_service.h" |
22 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_split.h" | 24 #include "base/strings/string_split.h" |
24 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
25 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
26 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 #include "chrome/common/chrome_paths.h" | 100 #include "chrome/common/chrome_paths.h" |
100 #include "chrome/common/chrome_switches.h" | 101 #include "chrome/common/chrome_switches.h" |
101 #include "chrome/common/env_vars.h" | 102 #include "chrome/common/env_vars.h" |
102 #include "chrome/common/features.h" | 103 #include "chrome/common/features.h" |
103 #include "chrome/common/logging_chrome.h" | 104 #include "chrome/common/logging_chrome.h" |
104 #include "chrome/common/pepper_permission_util.h" | 105 #include "chrome/common/pepper_permission_util.h" |
105 #include "chrome/common/pref_names.h" | 106 #include "chrome/common/pref_names.h" |
106 #include "chrome/common/render_messages.h" | 107 #include "chrome/common/render_messages.h" |
107 #include "chrome/common/secure_origin_whitelist.h" | 108 #include "chrome/common/secure_origin_whitelist.h" |
108 #include "chrome/common/url_constants.h" | 109 #include "chrome/common/url_constants.h" |
110 #include "chrome/grit/browser_resources.h" | |
109 #include "chrome/grit/generated_resources.h" | 111 #include "chrome/grit/generated_resources.h" |
110 #include "chrome/installer/util/google_update_settings.h" | 112 #include "chrome/installer/util/google_update_settings.h" |
111 #include "chromeos/chromeos_constants.h" | 113 #include "chromeos/chromeos_constants.h" |
112 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 114 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
113 #include "components/autofill/core/common/autofill_switches.h" | 115 #include "components/autofill/core/common/autofill_switches.h" |
114 #include "components/cdm/browser/cdm_message_filter_android.h" | 116 #include "components/cdm/browser/cdm_message_filter_android.h" |
115 #include "components/cloud_devices/common/cloud_devices_switches.h" | 117 #include "components/cloud_devices/common/cloud_devices_switches.h" |
116 #include "components/content_settings/core/browser/content_settings_utils.h" | 118 #include "components/content_settings/core/browser/content_settings_utils.h" |
117 #include "components/content_settings/core/browser/cookie_settings.h" | 119 #include "components/content_settings/core/browser/cookie_settings.h" |
118 #include "components/content_settings/core/browser/host_content_settings_map.h" | 120 #include "components/content_settings/core/browser/host_content_settings_map.h" |
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2957 } | 2959 } |
2958 | 2960 |
2959 void ChromeContentBrowserClient::RegisterOutOfProcessMojoApplications( | 2961 void ChromeContentBrowserClient::RegisterOutOfProcessMojoApplications( |
2960 OutOfProcessMojoApplicationMap* apps) { | 2962 OutOfProcessMojoApplicationMap* apps) { |
2961 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | 2963 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) |
2962 apps->insert(std::make_pair("mojo:media", | 2964 apps->insert(std::make_pair("mojo:media", |
2963 base::ASCIIToUTF16("Media App"))); | 2965 base::ASCIIToUTF16("Media App"))); |
2964 #endif | 2966 #endif |
2965 } | 2967 } |
2966 | 2968 |
2969 std::unique_ptr<base::Value> | |
2970 ChromeContentBrowserClient::GetServiceManifestOverlay( | |
2971 const std::string& name) { | |
2972 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | |
2973 int id = -1; | |
2974 if (name == "exe:content_browser") | |
Ken Rockot(use gerrit already)
2016/09/09 23:26:41
Hmm. Guess we should move the constants from conte
| |
2975 id = IDR_CONTENT_BROWSER_MANIFEST_OVERLAY; | |
2976 if (id == -1) | |
2977 return nullptr; | |
2978 | |
2979 base::StringPiece manifest_contents = | |
2980 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | |
2981 return base::JSONReader::Read(manifest_contents); | |
2982 } | |
2983 | |
2967 void ChromeContentBrowserClient::OpenURL( | 2984 void ChromeContentBrowserClient::OpenURL( |
2968 content::BrowserContext* browser_context, | 2985 content::BrowserContext* browser_context, |
2969 const content::OpenURLParams& params, | 2986 const content::OpenURLParams& params, |
2970 const base::Callback<void(content::WebContents*)>& callback) { | 2987 const base::Callback<void(content::WebContents*)>& callback) { |
2971 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2988 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2972 | 2989 |
2973 #if BUILDFLAG(ANDROID_JAVA_UI) | 2990 #if BUILDFLAG(ANDROID_JAVA_UI) |
2974 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, | 2991 ServiceTabLauncher::GetInstance()->LaunchTab(browser_context, params, |
2975 callback); | 2992 callback); |
2976 #else | 2993 #else |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3168 if (channel <= kMaxDisableEncryptionChannel) { | 3185 if (channel <= kMaxDisableEncryptionChannel) { |
3169 static const char* const kWebRtcDevSwitchNames[] = { | 3186 static const char* const kWebRtcDevSwitchNames[] = { |
3170 switches::kDisableWebRtcEncryption, | 3187 switches::kDisableWebRtcEncryption, |
3171 }; | 3188 }; |
3172 to_command_line->CopySwitchesFrom(from_command_line, | 3189 to_command_line->CopySwitchesFrom(from_command_line, |
3173 kWebRtcDevSwitchNames, | 3190 kWebRtcDevSwitchNames, |
3174 arraysize(kWebRtcDevSwitchNames)); | 3191 arraysize(kWebRtcDevSwitchNames)); |
3175 } | 3192 } |
3176 } | 3193 } |
3177 #endif // defined(ENABLE_WEBRTC) | 3194 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |