| 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 "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/password_manager/password_manager.h" | 9 #include "chrome/browser/password_manager/password_manager.h" |
| 10 #include "chrome/browser/tab_contents/tab_util.h" | 10 #include "chrome/browser/tab_contents/tab_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // disassociating the model from the view, because the view will | 128 // disassociating the model from the view, because the view will |
| 129 // be deleted before the password manager. | 129 // be deleted before the password manager. |
| 130 login_view_ = new LoginView(explanation, manager); | 130 login_view_ = new LoginView(explanation, manager); |
| 131 | 131 |
| 132 // Scary thread safety note: This can potentially be called *after* SetAuth | 132 // Scary thread safety note: This can potentially be called *after* SetAuth |
| 133 // or CancelAuth (say, if the request was cancelled before the UI thread got | 133 // or CancelAuth (say, if the request was cancelled before the UI thread got |
| 134 // control). However, that's OK since any UI interaction in those functions | 134 // control). However, that's OK since any UI interaction in those functions |
| 135 // will occur via an InvokeLater on the UI thread, which is guaranteed | 135 // will occur via an InvokeLater on the UI thread, which is guaranteed |
| 136 // to happen after this is called (since this was InvokeLater'd first). | 136 // to happen after this is called (since this was InvokeLater'd first). |
| 137 WebContents* requesting_contents = GetWebContentsForLogin(); | 137 WebContents* requesting_contents = GetWebContentsForLogin(); |
| 138 SetDialog(new ConstrainedWindowViews(requesting_contents, this)); | 138 SetDialog(ConstrainedWindowViews::Create(requesting_contents, this)); |
| 139 NotifyAuthNeeded(); | 139 NotifyAuthNeeded(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 friend class base::RefCountedThreadSafe<LoginHandlerViews>; | 143 friend class base::RefCountedThreadSafe<LoginHandlerViews>; |
| 144 friend class LoginPrompt; | 144 friend class LoginPrompt; |
| 145 | 145 |
| 146 ~LoginHandlerViews() {} | 146 ~LoginHandlerViews() {} |
| 147 | 147 |
| 148 // The LoginView that contains the user's login information | 148 // The LoginView that contains the user's login information |
| 149 LoginView* login_view_; | 149 LoginView* login_view_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); | 151 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 // static | 154 // static |
| 155 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 155 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 156 net::URLRequest* request) { | 156 net::URLRequest* request) { |
| 157 return new LoginHandlerViews(auth_info, request); | 157 return new LoginHandlerViews(auth_info, request); |
| 158 } | 158 } |
| OLD | NEW |