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

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

Issue 1742053002: Move trial token code to content/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "components/web_cache/renderer/web_cache_render_process_observer.h" 8 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
9 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
10 #include "content/shell/renderer/shell_render_view_observer.h" 10 #include "content/shell/renderer/shell_render_view_observer.h"
11 #include "third_party/WebKit/public/web/WebView.h" 11 #include "third_party/WebKit/public/web/WebView.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 #if defined(ENABLE_PLUGINS) 14 #if defined(ENABLE_PLUGINS)
15 #include "ppapi/shared_impl/ppapi_switches.h" 15 #include "ppapi/shared_impl/ppapi_switches.h"
16 #endif 16 #endif
17 17
18 namespace content { 18 namespace content {
19 19
20 namespace { 20 ShellContentRendererClient::ShellContentRendererClient() {}
21
22 // This is the public key which the content shell will use to enable origin
23 // trial features.
24 // TODO(iclelland): Update this comment with the location of the public and
25 // private key files when the command-line tool CL lands
26 static const uint8_t kOriginTrialPublicKey[] = {
27 0x75, 0x10, 0xac, 0xf9, 0x3a, 0x1c, 0xb8, 0xa9, 0x28, 0x70, 0xd2,
28 0x9a, 0xd0, 0x0b, 0x59, 0xe1, 0xac, 0x2b, 0xb7, 0xd5, 0xca, 0x1f,
29 0x64, 0x90, 0x08, 0x8e, 0xa8, 0xe0, 0x56, 0x3a, 0x04, 0xd0,
30 };
31 } // namespace
32
33 ShellContentRendererClient::ShellContentRendererClient()
34 : origin_trial_public_key_(base::StringPiece(
35 reinterpret_cast<const char*>(kOriginTrialPublicKey),
36 arraysize(kOriginTrialPublicKey))) {}
37 21
38 ShellContentRendererClient::~ShellContentRendererClient() { 22 ShellContentRendererClient::~ShellContentRendererClient() {
39 } 23 }
40 24
41 void ShellContentRendererClient::RenderThreadStarted() { 25 void ShellContentRendererClient::RenderThreadStarted() {
42 RenderThread* thread = RenderThread::Get(); 26 RenderThread* thread = RenderThread::Get();
43 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); 27 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver());
44 thread->AddObserver(web_cache_observer_.get()); 28 thread->AddObserver(web_cache_observer_.get());
45 } 29 }
46 30
(...skipping 13 matching lines...) Expand all
60 44
61 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { 45 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
62 #if defined(ENABLE_PLUGINS) 46 #if defined(ENABLE_PLUGINS)
63 return base::CommandLine::ForCurrentProcess()->HasSwitch( 47 return base::CommandLine::ForCurrentProcess()->HasSwitch(
64 switches::kEnablePepperTesting); 48 switches::kEnablePepperTesting);
65 #else 49 #else
66 return false; 50 return false;
67 #endif 51 #endif
68 } 52 }
69 53
70 base::StringPiece ShellContentRendererClient::GetOriginTrialPublicKey() {
71 return origin_trial_public_key_;
72 }
73
74 } // namespace content 54 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698