| 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/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/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" |
| 11 #include "chrome/browser/ui/views/constrained_window_views.h" | |
| 12 #include "chrome/browser/ui/views/login_view.h" | 11 #include "chrome/browser/ui/views/login_view.h" |
| 13 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 14 #include "components/web_modal/web_contents_modal_dialog_host.h" | 13 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 14 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 16 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 15 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
| 19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 20 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 21 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return true; | 102 return true; |
| 104 } | 103 } |
| 105 | 104 |
| 106 virtual bool Accept() OVERRIDE { | 105 virtual bool Accept() OVERRIDE { |
| 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 108 | 107 |
| 109 SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); | 108 SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); |
| 110 return true; | 109 return true; |
| 111 } | 110 } |
| 112 | 111 |
| 113 // TODO(wittman): Remove this override once we move to the new style frame | |
| 114 // view on all dialogs. | |
| 115 virtual views::NonClientFrameView* CreateNonClientFrameView( | |
| 116 views::Widget* widget) OVERRIDE { | |
| 117 return CreateConstrainedStyleNonClientFrameView( | |
| 118 widget, | |
| 119 GetWebContentsForLogin()->GetBrowserContext()); | |
| 120 } | |
| 121 | |
| 122 virtual views::View* GetInitiallyFocusedView() OVERRIDE { | 112 virtual views::View* GetInitiallyFocusedView() OVERRIDE { |
| 123 return login_view_->GetInitiallyFocusedView(); | 113 return login_view_->GetInitiallyFocusedView(); |
| 124 } | 114 } |
| 125 | 115 |
| 126 virtual views::View* GetContentsView() OVERRIDE { | 116 virtual views::View* GetContentsView() OVERRIDE { |
| 127 return login_view_; | 117 return login_view_; |
| 128 } | 118 } |
| 129 virtual views::Widget* GetWidget() OVERRIDE { | 119 virtual views::Widget* GetWidget() OVERRIDE { |
| 130 return login_view_->GetWidget(); | 120 return login_view_->GetWidget(); |
| 131 } | 121 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 views::Widget* dialog_; | 172 views::Widget* dialog_; |
| 183 | 173 |
| 184 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); | 174 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); |
| 185 }; | 175 }; |
| 186 | 176 |
| 187 // static | 177 // static |
| 188 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 178 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 189 net::URLRequest* request) { | 179 net::URLRequest* request) { |
| 190 return new LoginHandlerViews(auth_info, request); | 180 return new LoginHandlerViews(auth_info, request); |
| 191 } | 181 } |
| OLD | NEW |