| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 #include "chrome/common/chrome_constants.h" | 95 #include "chrome/common/chrome_constants.h" |
| 96 #include "chrome/common/chrome_paths.h" | 96 #include "chrome/common/chrome_paths.h" |
| 97 #include "chrome/common/chrome_switches.h" | 97 #include "chrome/common/chrome_switches.h" |
| 98 #include "chrome/common/env_vars.h" | 98 #include "chrome/common/env_vars.h" |
| 99 #include "chrome/common/features.h" | 99 #include "chrome/common/features.h" |
| 100 #include "chrome/common/logging_chrome.h" | 100 #include "chrome/common/logging_chrome.h" |
| 101 #include "chrome/common/pepper_permission_util.h" | 101 #include "chrome/common/pepper_permission_util.h" |
| 102 #include "chrome/common/pref_names.h" | 102 #include "chrome/common/pref_names.h" |
| 103 #include "chrome/common/render_messages.h" | 103 #include "chrome/common/render_messages.h" |
| 104 #include "chrome/common/url_constants.h" | 104 #include "chrome/common/url_constants.h" |
| 105 #include "chrome/grit/browser_resources.h" |
| 105 #include "chrome/grit/generated_resources.h" | 106 #include "chrome/grit/generated_resources.h" |
| 106 #include "chrome/installer/util/google_update_settings.h" | 107 #include "chrome/installer/util/google_update_settings.h" |
| 107 #include "chromeos/chromeos_constants.h" | 108 #include "chromeos/chromeos_constants.h" |
| 108 #include "components/autofill/core/common/autofill_switches.h" | 109 #include "components/autofill/core/common/autofill_switches.h" |
| 109 #include "components/cdm/browser/cdm_message_filter_android.h" | 110 #include "components/cdm/browser/cdm_message_filter_android.h" |
| 110 #include "components/cloud_devices/common/cloud_devices_switches.h" | 111 #include "components/cloud_devices/common/cloud_devices_switches.h" |
| 111 #include "components/content_settings/core/browser/content_settings_utils.h" | 112 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 112 #include "components/content_settings/core/browser/cookie_settings.h" | 113 #include "components/content_settings/core/browser/cookie_settings.h" |
| 113 #include "components/content_settings/core/browser/host_content_settings_map.h" | 114 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 114 #include "components/content_settings/core/common/content_settings.h" | 115 #include "components/content_settings/core/common/content_settings.h" |
| (...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 } | 2771 } |
| 2771 | 2772 |
| 2772 return false; | 2773 return false; |
| 2773 } | 2774 } |
| 2774 | 2775 |
| 2775 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2776 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
| 2776 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2777 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
| 2777 } | 2778 } |
| 2778 #endif // defined(OS_WIN) | 2779 #endif // defined(OS_WIN) |
| 2779 | 2780 |
| 2781 std::string ChromeContentBrowserClient::GetPackagedMojoApplicationName() { |
| 2782 return "exe:chrome"; |
| 2783 } |
| 2784 |
| 2785 std::string ChromeContentBrowserClient::GetMojoApplicationNameForProcess( |
| 2786 content::ProcessType type) { |
| 2787 switch (type) { |
| 2788 case content::PROCESS_TYPE_RENDERER: |
| 2789 return "exe:chrome_renderer"; |
| 2790 |
| 2791 default: |
| 2792 return std::string(); |
| 2793 } |
| 2794 } |
| 2795 |
| 2796 bool ChromeContentBrowserClient::GetMojoApplicationManifest( |
| 2797 const base::StringPiece& name, |
| 2798 std::string* manifest_contents) { |
| 2799 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 2800 if (name == "exe:chrome") { |
| 2801 *manifest_contents = |
| 2802 rb.GetRawDataResource(IDR_MOJO_CHROME_MANIFEST).as_string(); |
| 2803 return true; |
| 2804 } else if (name == "exe:chrome_renderer") { |
| 2805 *manifest_contents = |
| 2806 rb.GetRawDataResource(IDR_MOJO_CHROME_RENDERER_MANIFEST).as_string(); |
| 2807 return true; |
| 2808 } |
| 2809 |
| 2810 return false; |
| 2811 } |
| 2812 |
| 2780 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2813 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
| 2781 content::ServiceRegistry* registry, | 2814 content::ServiceRegistry* registry, |
| 2782 content::RenderFrameHost* render_frame_host) { | 2815 content::RenderFrameHost* render_frame_host) { |
| 2783 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2816 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
| 2784 #if defined(OS_CHROMEOS) | 2817 #if defined(OS_CHROMEOS) |
| 2785 registry->AddService( | 2818 registry->AddService( |
| 2786 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2819 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
| 2787 render_frame_host)); | 2820 render_frame_host)); |
| 2788 #endif // defined(OS_CHROMEOS) | 2821 #endif // defined(OS_CHROMEOS) |
| 2789 | 2822 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2979 if (channel <= kMaxDisableEncryptionChannel) { | 3012 if (channel <= kMaxDisableEncryptionChannel) { |
| 2980 static const char* const kWebRtcDevSwitchNames[] = { | 3013 static const char* const kWebRtcDevSwitchNames[] = { |
| 2981 switches::kDisableWebRtcEncryption, | 3014 switches::kDisableWebRtcEncryption, |
| 2982 }; | 3015 }; |
| 2983 to_command_line->CopySwitchesFrom(from_command_line, | 3016 to_command_line->CopySwitchesFrom(from_command_line, |
| 2984 kWebRtcDevSwitchNames, | 3017 kWebRtcDevSwitchNames, |
| 2985 arraysize(kWebRtcDevSwitchNames)); | 3018 arraysize(kWebRtcDevSwitchNames)); |
| 2986 } | 3019 } |
| 2987 } | 3020 } |
| 2988 #endif // defined(ENABLE_WEBRTC) | 3021 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |