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

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

Issue 13409003: Hide ContentClient getters from embedders so that they they don't reuse content's embedder API. The… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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/shell_content_renderer_client.h" 5 #include "content/shell/shell_content_renderer_client.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "content/public/common/content_constants.h" 10 #include "content/public/common/content_constants.h"
(...skipping 24 matching lines...) Expand all
35 using WebKit::WebPluginParams; 35 using WebKit::WebPluginParams;
36 using WebKit::WebRTCPeerConnectionHandler; 36 using WebKit::WebRTCPeerConnectionHandler;
37 using WebKit::WebRTCPeerConnectionHandlerClient; 37 using WebKit::WebRTCPeerConnectionHandlerClient;
38 using WebKit::WebThemeEngine; 38 using WebKit::WebThemeEngine;
39 using WebTestRunner::WebTestDelegate; 39 using WebTestRunner::WebTestDelegate;
40 using WebTestRunner::WebTestInterfaces; 40 using WebTestRunner::WebTestInterfaces;
41 using WebTestRunner::WebTestProxyBase; 41 using WebTestRunner::WebTestProxyBase;
42 42
43 namespace content { 43 namespace content {
44 44
45 namespace {
brettw 2013/04/03 23:40:26 Nit: blank line after this.
46 ShellContentRendererClient* g_renderer_client;
47 }
48
49 ShellContentRendererClient* ShellContentRendererClient::Get() {
50 return g_renderer_client;
51 }
52
45 ShellContentRendererClient::ShellContentRendererClient() { 53 ShellContentRendererClient::ShellContentRendererClient() {
54 DCHECK(!g_renderer_client);
55 g_renderer_client = this;
46 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { 56 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
47 EnableWebTestProxyCreation( 57 EnableWebTestProxyCreation(
48 base::Bind(&ShellContentRendererClient::WebTestProxyCreated, 58 base::Bind(&ShellContentRendererClient::WebTestProxyCreated,
49 base::Unretained(this))); 59 base::Unretained(this)));
50 } 60 }
51 } 61 }
52 62
53 ShellContentRendererClient::~ShellContentRendererClient() { 63 ShellContentRendererClient::~ShellContentRendererClient() {
64 g_renderer_client = NULL;
54 } 65 }
55 66
56 void ShellContentRendererClient::LoadHyphenDictionary( 67 void ShellContentRendererClient::LoadHyphenDictionary(
57 base::PlatformFile dict_file) { 68 base::PlatformFile dict_file) {
58 if (!hyphenator_) 69 if (!hyphenator_)
59 hyphenator_.reset(new webkit_glue::MockWebHyphenator); 70 hyphenator_.reset(new webkit_glue::MockWebHyphenator);
60 base::SeekPlatformFile(dict_file, base::PLATFORM_FILE_FROM_BEGIN, 0); 71 base::SeekPlatformFile(dict_file, base::PLATFORM_FILE_FROM_BEGIN, 0);
61 hyphenator_->LoadDictionary(dict_file); 72 hyphenator_->LoadDictionary(dict_file);
62 } 73 }
63 74
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (CommandLine::ForCurrentProcess()->HasSwitch( 189 if (CommandLine::ForCurrentProcess()->HasSwitch(
179 switches::kEnableBrowserPluginForAllViewTypes)) { 190 switches::kEnableBrowserPluginForAllViewTypes)) {
180 // Allow BrowserPlugin if forced by command line flag. This is generally 191 // Allow BrowserPlugin if forced by command line flag. This is generally
181 // true for tests. 192 // true for tests.
182 return true; 193 return true;
183 } 194 }
184 return ContentRendererClient::AllowBrowserPlugin(container); 195 return ContentRendererClient::AllowBrowserPlugin(container);
185 } 196 }
186 197
187 } // namespace content 198 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698