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

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

Issue 10860066: [content shell] disable the auth prompt during layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_resource_dispatcher_host_delegate.h" 5 #include "content/shell/shell_resource_dispatcher_host_delegate.h"
6 6
7 #include "base/command_line.h"
7 #include "content/shell/shell_login_dialog.h" 8 #include "content/shell/shell_login_dialog.h"
9 #include "content/shell/shell_switches.h"
8 10
9 namespace content { 11 namespace content {
10 12
11 ShellResourceDispatcherHostDelegate::ShellResourceDispatcherHostDelegate() { 13 ShellResourceDispatcherHostDelegate::ShellResourceDispatcherHostDelegate() {
12 } 14 }
13 15
14 ShellResourceDispatcherHostDelegate::~ShellResourceDispatcherHostDelegate() { 16 ShellResourceDispatcherHostDelegate::~ShellResourceDispatcherHostDelegate() {
15 } 17 }
16 18
17 bool ShellResourceDispatcherHostDelegate::AcceptAuthRequest( 19 bool ShellResourceDispatcherHostDelegate::AcceptAuthRequest(
18 net::URLRequest* request, 20 net::URLRequest* request,
19 net::AuthChallengeInfo* auth_info) { 21 net::AuthChallengeInfo* auth_info) {
20 // Why not give it a try? 22 bool accept_auth_request =
21 return true; 23 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree);
24 return accept_auth_request;
22 } 25 }
23 26
24 ResourceDispatcherHostLoginDelegate* 27 ResourceDispatcherHostLoginDelegate*
25 ShellResourceDispatcherHostDelegate::CreateLoginDelegate( 28 ShellResourceDispatcherHostDelegate::CreateLoginDelegate(
26 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { 29 net::AuthChallengeInfo* auth_info, net::URLRequest* request) {
27 if (!login_request_callback_.is_null()) { 30 if (!login_request_callback_.is_null()) {
28 login_request_callback_.Run(); 31 login_request_callback_.Run();
29 login_request_callback_.Reset(); 32 login_request_callback_.Reset();
30 return NULL; 33 return NULL;
31 } 34 }
32 35
33 #if !defined(OS_MACOSX) && !defined(TOOLKIT_GTK) 36 #if !defined(OS_MACOSX) && !defined(TOOLKIT_GTK)
34 // TODO: implement ShellLoginDialog for other platforms, drop this #if 37 // TODO: implement ShellLoginDialog for other platforms, drop this #if
35 return NULL; 38 return NULL;
36 #else 39 #else
37 return new ShellLoginDialog(auth_info, request); 40 return new ShellLoginDialog(auth_info, request);
38 #endif 41 #endif
39 } 42 }
40 43
41 } // namespace content 44 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698