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

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

Issue 565943002: Credential Manager: Introduce a MockCredentialManagerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 "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 "components/web_cache/renderer/web_cache_render_process_observer.h" 10 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
11 #include "content/common/sandbox_win.h" 11 #include "content/common/sandbox_win.h"
12 #include "content/public/common/content_constants.h" 12 #include "content/public/common/content_constants.h"
13 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
14 #include "content/public/renderer/render_thread.h" 14 #include "content/public/renderer/render_thread.h"
15 #include "content/public/renderer/render_view.h" 15 #include "content/public/renderer/render_view.h"
16 #include "content/public/test/layouttest_support.h" 16 #include "content/public/test/layouttest_support.h"
17 #include "content/shell/common/shell_switches.h" 17 #include "content/shell/common/shell_switches.h"
18 #include "content/shell/common/webkit_test_helpers.h" 18 #include "content/shell/common/webkit_test_helpers.h"
19 #include "content/shell/renderer/shell_render_frame_observer.h" 19 #include "content/shell/renderer/shell_render_frame_observer.h"
20 #include "content/shell/renderer/shell_render_process_observer.h" 20 #include "content/shell/renderer/shell_render_process_observer.h"
21 #include "content/shell/renderer/shell_render_view_observer.h" 21 #include "content/shell/renderer/shell_render_view_observer.h"
22 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" 22 #include "content/shell/renderer/test_runner/WebTestInterfaces.h"
23 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
23 #include "content/shell/renderer/test_runner/web_test_proxy.h" 24 #include "content/shell/renderer/test_runner/web_test_proxy.h"
24 #include "content/shell/renderer/webkit_test_runner.h" 25 #include "content/shell/renderer/webkit_test_runner.h"
25 #include "content/test/mock_webclipboard_impl.h" 26 #include "content/test/mock_webclipboard_impl.h"
26 #include "ppapi/shared_impl/ppapi_switches.h" 27 #include "ppapi/shared_impl/ppapi_switches.h"
27 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" 28 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
28 #include "third_party/WebKit/public/web/WebPluginParams.h" 29 #include "third_party/WebKit/public/web/WebPluginParams.h"
29 #include "third_party/WebKit/public/web/WebView.h" 30 #include "third_party/WebKit/public/web/WebView.h"
30 #include "v8/include/v8.h" 31 #include "v8/include/v8.h"
31 32
32 #if defined(OS_WIN) 33 #if defined(OS_WIN)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { 105 void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) {
105 new ShellRenderViewObserver(render_view); 106 new ShellRenderViewObserver(render_view);
106 107
107 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 108 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
108 return; 109 return;
109 WebKitTestRunner* test_runner = WebKitTestRunner::Get(render_view); 110 WebKitTestRunner* test_runner = WebKitTestRunner::Get(render_view);
110 test_runner->Reset(); 111 test_runner->Reset();
111 render_view->GetWebView()->setSpellCheckClient( 112 render_view->GetWebView()->setSpellCheckClient(
112 test_runner->proxy()->GetSpellCheckClient()); 113 test_runner->proxy()->GetSpellCheckClient());
114
115 render_view->GetWebView()->setCredentialManagerClient(
116 test_runner->proxy()->GetCredentialManagerClientMock());
113 WebTestDelegate* delegate = 117 WebTestDelegate* delegate =
114 ShellRenderProcessObserver::GetInstance()->test_delegate(); 118 ShellRenderProcessObserver::GetInstance()->test_delegate();
115 if (delegate == static_cast<WebTestDelegate*>(test_runner)) 119 if (delegate == static_cast<WebTestDelegate*>(test_runner))
116 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view); 120 ShellRenderProcessObserver::GetInstance()->SetMainWindow(render_view);
117 } 121 }
118 122
119 bool ShellContentRendererClient::OverrideCreatePlugin( 123 bool ShellContentRendererClient::OverrideCreatePlugin(
120 RenderFrame* render_frame, 124 RenderFrame* render_frame,
121 WebLocalFrame* frame, 125 WebLocalFrame* frame,
122 const WebPluginParams& params, 126 const WebPluginParams& params,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return CommandLine::ForCurrentProcess()->HasSwitch( 212 return CommandLine::ForCurrentProcess()->HasSwitch(
209 switches::kEnablePepperTesting); 213 switches::kEnablePepperTesting);
210 } 214 }
211 215
212 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { 216 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
213 return CommandLine::ForCurrentProcess()->HasSwitch( 217 return CommandLine::ForCurrentProcess()->HasSwitch(
214 switches::kEnablePepperTesting); 218 switches::kEnablePepperTesting);
215 } 219 }
216 220
217 } // namespace content 221 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698