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 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2775 } | 2776 } |
2776 | 2777 |
2777 return false; | 2778 return false; |
2778 } | 2779 } |
2779 | 2780 |
2780 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2781 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
2781 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2782 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
2782 } | 2783 } |
2783 #endif // defined(OS_WIN) | 2784 #endif // defined(OS_WIN) |
2784 | 2785 |
| 2786 std::string ChromeContentBrowserClient::GetPackagedMojoApplicationName() { |
| 2787 return "exe:chrome"; |
| 2788 } |
| 2789 |
| 2790 std::string ChromeContentBrowserClient::GetMojoApplicationNameForProcess( |
| 2791 content::ProcessType type) { |
| 2792 switch (type) { |
| 2793 case content::PROCESS_TYPE_RENDERER: |
| 2794 return "exe:chrome_renderer"; |
| 2795 |
| 2796 default: |
| 2797 return std::string(); |
| 2798 } |
| 2799 } |
| 2800 |
| 2801 bool ChromeContentBrowserClient::GetMojoApplicationManifest( |
| 2802 const base::StringPiece& name, |
| 2803 std::string* manifest_contents) { |
| 2804 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 2805 if (name == "exe:chrome") { |
| 2806 *manifest_contents = |
| 2807 rb.GetRawDataResource(IDR_MOJO_CHROME_MANIFEST).as_string(); |
| 2808 return true; |
| 2809 } else if (name == "exe:chrome_renderer") { |
| 2810 *manifest_contents = |
| 2811 rb.GetRawDataResource(IDR_MOJO_CHROME_RENDERER_MANIFEST).as_string(); |
| 2812 return true; |
| 2813 } else if (name == "mojo:catalog") { |
| 2814 *manifest_contents = |
| 2815 rb.GetRawDataResource(IDR_MOJO_CATALOG_MANIFEST).as_string(); |
| 2816 return true; |
| 2817 } |
| 2818 |
| 2819 return false; |
| 2820 } |
| 2821 |
2785 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2822 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
2786 content::ServiceRegistry* registry, | 2823 content::ServiceRegistry* registry, |
2787 content::RenderFrameHost* render_frame_host) { | 2824 content::RenderFrameHost* render_frame_host) { |
2788 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2825 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2789 #if defined(OS_CHROMEOS) | 2826 #if defined(OS_CHROMEOS) |
2790 registry->AddService( | 2827 registry->AddService( |
2791 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2828 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2792 render_frame_host)); | 2829 render_frame_host)); |
2793 #endif // defined(OS_CHROMEOS) | 2830 #endif // defined(OS_CHROMEOS) |
2794 | 2831 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2986 if (channel <= kMaxDisableEncryptionChannel) { | 3023 if (channel <= kMaxDisableEncryptionChannel) { |
2987 static const char* const kWebRtcDevSwitchNames[] = { | 3024 static const char* const kWebRtcDevSwitchNames[] = { |
2988 switches::kDisableWebRtcEncryption, | 3025 switches::kDisableWebRtcEncryption, |
2989 }; | 3026 }; |
2990 to_command_line->CopySwitchesFrom(from_command_line, | 3027 to_command_line->CopySwitchesFrom(from_command_line, |
2991 kWebRtcDevSwitchNames, | 3028 kWebRtcDevSwitchNames, |
2992 arraysize(kWebRtcDevSwitchNames)); | 3029 arraysize(kWebRtcDevSwitchNames)); |
2993 } | 3030 } |
2994 } | 3031 } |
2995 #endif // defined(ENABLE_WEBRTC) | 3032 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |