OLD | NEW |
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 "chrome/browser/ui/login/login_prompt.h" | 5 #include "chrome/browser/ui/login/login_prompt.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
32 #include "ui/base/text/text_elider.h" | 32 #include "ui/base/text/text_elider.h" |
33 | 33 |
34 using content::BrowserThread; | 34 using content::BrowserThread; |
35 using content::NavigationController; | 35 using content::NavigationController; |
36 using content::RenderViewHost; | 36 using content::RenderViewHost; |
37 using content::RenderViewHostDelegate; | 37 using content::RenderViewHostDelegate; |
38 using content::ResourceDispatcherHost; | 38 using content::ResourceDispatcherHost; |
39 using content::ResourceRequestInfo; | 39 using content::ResourceRequestInfo; |
40 using content::WebContents; | 40 using content::WebContents; |
41 using webkit::forms::PasswordForm; | 41 using content::PasswordForm; |
42 | 42 |
43 class LoginHandlerImpl; | 43 class LoginHandlerImpl; |
44 | 44 |
45 // Helper to remove the ref from an net::URLRequest to the LoginHandler. | 45 // Helper to remove the ref from an net::URLRequest to the LoginHandler. |
46 // Should only be called from the IO thread, since it accesses an | 46 // Should only be called from the IO thread, since it accesses an |
47 // net::URLRequest. | 47 // net::URLRequest. |
48 void ResetLoginHandlerForRequest(net::URLRequest* request) { | 48 void ResetLoginHandlerForRequest(net::URLRequest* request) { |
49 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request); | 49 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request); |
50 } | 50 } |
51 | 51 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) << | 108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) << |
109 "Why is OnRequestCancelled called from the UI thread?"; | 109 "Why is OnRequestCancelled called from the UI thread?"; |
110 | 110 |
111 // Reference is no longer valid. | 111 // Reference is no longer valid. |
112 request_ = NULL; | 112 request_ = NULL; |
113 | 113 |
114 // Give up on auth if the request was cancelled. | 114 // Give up on auth if the request was cancelled. |
115 CancelAuth(); | 115 CancelAuth(); |
116 } | 116 } |
117 | 117 |
118 void LoginHandler::SetPasswordForm(const webkit::forms::PasswordForm& form) { | 118 void LoginHandler::SetPasswordForm(const content::PasswordForm& form) { |
119 password_form_ = form; | 119 password_form_ = form; |
120 } | 120 } |
121 | 121 |
122 void LoginHandler::SetPasswordManager(PasswordManager* password_manager) { | 122 void LoginHandler::SetPasswordManager(PasswordManager* password_manager) { |
123 password_manager_ = password_manager; | 123 password_manager_ = password_manager; |
124 } | 124 } |
125 | 125 |
126 WebContents* LoginHandler::GetWebContentsForLogin() const { | 126 WebContents* LoginHandler::GetWebContentsForLogin() const { |
127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
128 | 128 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 468 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
469 net::URLRequest* request) { | 469 net::URLRequest* request) { |
470 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 470 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
471 BrowserThread::PostTask( | 471 BrowserThread::PostTask( |
472 BrowserThread::UI, FROM_HERE, | 472 BrowserThread::UI, FROM_HERE, |
473 base::Bind(&LoginDialogCallback, request->url(), | 473 base::Bind(&LoginDialogCallback, request->url(), |
474 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); | 474 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); |
475 return handler; | 475 return handler; |
476 } | 476 } |
OLD | NEW |