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 "content/shell/renderer/shell_content_renderer_client.h" | 5 #include "content/shell/renderer/shell_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" |
13 #include "components/web_cache/renderer/web_cache_impl.h" | 14 #include "components/web_cache/renderer/web_cache_impl.h" |
14 #include "content/public/test/test_mojo_service.mojom.h" | 15 #include "content/public/test/test_mojo_service.mojom.h" |
15 #include "content/shell/common/shell_switches.h" | 16 #include "content/shell/common/shell_switches.h" |
16 #include "content/shell/renderer/shell_render_view_observer.h" | 17 #include "content/shell/renderer/shell_render_view_observer.h" |
17 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
18 #include "mojo/public/cpp/system/message_pipe.h" | 19 #include "mojo/public/cpp/system/message_pipe.h" |
19 #include "services/shell/public/cpp/interface_registry.h" | 20 #include "services/shell/public/cpp/interface_registry.h" |
20 #include "third_party/WebKit/public/web/WebTestingSupport.h" | 21 #include "third_party/WebKit/public/web/WebTestingSupport.h" |
21 #include "third_party/WebKit/public/web/WebView.h" | 22 #include "third_party/WebKit/public/web/WebView.h" |
22 #include "v8/include/v8.h" | 23 #include "v8/include/v8.h" |
23 | 24 |
24 #if defined(ENABLE_PLUGINS) | 25 #if defined(ENABLE_PLUGINS) |
25 #include "ppapi/shared_impl/ppapi_switches.h" | 26 #include "ppapi/shared_impl/ppapi_switches.h" |
26 #endif | 27 #endif |
27 | 28 |
| 29 #if defined(OS_ANDROID) |
| 30 #include "base/feature_list.h" |
| 31 #include "media/base/media_switches.h" |
| 32 #endif |
| 33 |
28 namespace content { | 34 namespace content { |
29 | 35 |
30 namespace { | 36 namespace { |
31 | 37 |
32 // A test Mojo service which can be driven by browser tests for various reasons. | 38 // A test Mojo service which can be driven by browser tests for various reasons. |
33 class TestMojoServiceImpl : public mojom::TestMojoService { | 39 class TestMojoServiceImpl : public mojom::TestMojoService { |
34 public: | 40 public: |
35 explicit TestMojoServiceImpl(mojom::TestMojoServiceRequest request) | 41 explicit TestMojoServiceImpl(mojom::TestMojoServiceRequest request) |
36 : binding_(this, std::move(request)) { | 42 : binding_(this, std::move(request)) { |
37 binding_.set_connection_error_handler( | 43 binding_.set_connection_error_handler( |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 blink::WebTestingSupport::injectInternalsObject(context); | 133 blink::WebTestingSupport::injectInternalsObject(context); |
128 } | 134 } |
129 } | 135 } |
130 | 136 |
131 void ShellContentRendererClient::ExposeInterfacesToBrowser( | 137 void ShellContentRendererClient::ExposeInterfacesToBrowser( |
132 shell::InterfaceRegistry* interface_registry) { | 138 shell::InterfaceRegistry* interface_registry) { |
133 interface_registry->AddInterface<mojom::TestMojoService>( | 139 interface_registry->AddInterface<mojom::TestMojoService>( |
134 base::Bind(&CreateTestMojoService)); | 140 base::Bind(&CreateTestMojoService)); |
135 } | 141 } |
136 | 142 |
| 143 #if defined(OS_ANDROID) |
| 144 void ShellContentRendererClient::AddSupportedKeySystems( |
| 145 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) { |
| 146 if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) |
| 147 return; |
| 148 |
| 149 static const char kExternalClearKeyKeySystem[] = |
| 150 "org.chromium.externalclearkey"; |
| 151 key_systems->emplace_back( |
| 152 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem)); |
| 153 } |
| 154 #endif |
| 155 |
137 } // namespace content | 156 } // namespace content |
OLD | NEW |