| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/login_prompt.h" | 5 #include "chrome/browser/login_prompt.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/password_manager/password_manager.h" | 9 #include "chrome/browser/password_manager/password_manager.h" |
| 10 #include "chrome/browser/renderer_host/render_process_host.h" | 10 #include "chrome/browser/renderer_host/render_process_host.h" |
| 11 #include "chrome/browser/renderer_host/render_view_host.h" | 11 #include "chrome/browser/renderer_host/render_view_host.h" |
| 12 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 12 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 13 #include "chrome/browser/tab_contents/navigation_controller.h" | 13 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 15 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 16 #include "chrome/browser/tab_contents/tab_util.h" | 16 #include "chrome/browser/tab_contents/tab_util.h" |
| 17 #include "chrome/browser/views/login_view.h" | 17 #include "chrome/browser/views/login_view.h" |
| 18 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
| 21 #include "views/window/dialog_delegate.h" | 21 #include "views/window/dialog_delegate.h" |
| 22 | 22 |
| 23 using webkit_glue::PasswordForm; | 23 using webkit_glue::PasswordForm; |
| 24 | 24 |
| 25 // ---------------------------------------------------------------------------- | 25 // ---------------------------------------------------------------------------- |
| 26 // LoginHandlerWin | 26 // LoginHandlerWin |
| 27 | 27 |
| 28 // This class simply forwards the authentication from the LoginView (on | 28 // This class simply forwards the authentication from the LoginView (on |
| 29 // the UI thread) to the URLRequest (on the I/O thread). | 29 // the UI thread) to the net::URLRequest (on the I/O thread). |
| 30 // This class uses ref counting to ensure that it lives until all InvokeLaters | 30 // This class uses ref counting to ensure that it lives until all InvokeLaters |
| 31 // have been called. | 31 // have been called. |
| 32 class LoginHandlerWin : public LoginHandler, | 32 class LoginHandlerWin : public LoginHandler, |
| 33 public ConstrainedDialogDelegate { | 33 public ConstrainedDialogDelegate { |
| 34 public: | 34 public: |
| 35 LoginHandlerWin(net::AuthChallengeInfo* auth_info, URLRequest* request) | 35 LoginHandlerWin(net::AuthChallengeInfo* auth_info, net::URLRequest* request) |
| 36 : LoginHandler(auth_info, request) { | 36 : LoginHandler(auth_info, request) { |
| 37 } | 37 } |
| 38 | 38 |
| 39 // LoginModelObserver implementation. | 39 // LoginModelObserver implementation. |
| 40 virtual void OnAutofillDataAvailable(const std::wstring& username, | 40 virtual void OnAutofillDataAvailable(const std::wstring& username, |
| 41 const std::wstring& password) { | 41 const std::wstring& password) { |
| 42 // Nothing to do here since LoginView takes care of autofil for win. | 42 // Nothing to do here since LoginView takes care of autofil for win. |
| 43 } | 43 } |
| 44 | 44 |
| 45 void set_login_view(LoginView* login_view) { | 45 void set_login_view(LoginView* login_view) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 ~LoginHandlerWin() {} | 135 ~LoginHandlerWin() {} |
| 136 | 136 |
| 137 // The LoginView that contains the user's login information | 137 // The LoginView that contains the user's login information |
| 138 LoginView* login_view_; | 138 LoginView* login_view_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(LoginHandlerWin); | 140 DISALLOW_COPY_AND_ASSIGN(LoginHandlerWin); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 // static | 143 // static |
| 144 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 144 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 145 URLRequest* request) { | 145 net::URLRequest* request) { |
| 146 return new LoginHandlerWin(auth_info, request); | 146 return new LoginHandlerWin(auth_info, request); |
| 147 } | 147 } |
| OLD | NEW |