Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 2268283003: media: Add External Clear Key content browser test on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 blink::WebTestingSupport::injectInternalsObject(context); 128 blink::WebTestingSupport::injectInternalsObject(context);
123 } 129 }
124 } 130 }
125 131
126 void ShellContentRendererClient::ExposeInterfacesToBrowser( 132 void ShellContentRendererClient::ExposeInterfacesToBrowser(
127 shell::InterfaceRegistry* interface_registry) { 133 shell::InterfaceRegistry* interface_registry) {
128 interface_registry->AddInterface<mojom::TestMojoService>( 134 interface_registry->AddInterface<mojom::TestMojoService>(
129 base::Bind(&CreateTestMojoService)); 135 base::Bind(&CreateTestMojoService));
130 } 136 }
131 137
138 #if defined(OS_ANDROID)
139 void ShellContentRendererClient::AddSupportedKeySystems(
140 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) {
141 if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting))
Peter Beverloo 2016/09/22 11:55:23 Out of interest, why do you use a base::Feature fo
xhwang 2016/09/22 16:54:58 Yeah, I wanted to add a command line flag but was
142 return;
143
144 static const char kExternalClearKeyKeySystem[] =
145 "org.chromium.externalclearkey";
146 key_systems->emplace_back(
147 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem));
148 }
149 #endif
150
132 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698