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