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" | 11 #include "chrome/browser/ui/views/constrained_window_views.h" |
Mike Wittman
2014/02/07 15:02:44
Remove this?
Lei Zhang
2014/02/07 22:55:21
Done.
| |
12 #include "chrome/browser/ui/views/login_view.h" | 12 #include "chrome/browser/ui/views/login_view.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "components/web_modal/web_contents_modal_dialog_host.h" | 14 #include "components/web_modal/web_contents_modal_dialog_host.h" |
15 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
16 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 16 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 return true; | 103 return true; |
104 } | 104 } |
105 | 105 |
106 virtual bool Accept() OVERRIDE { | 106 virtual bool Accept() OVERRIDE { |
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
108 | 108 |
109 SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); | 109 SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
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 { | 113 virtual views::View* GetInitiallyFocusedView() OVERRIDE { |
123 return login_view_->GetInitiallyFocusedView(); | 114 return login_view_->GetInitiallyFocusedView(); |
124 } | 115 } |
125 | 116 |
126 virtual views::View* GetContentsView() OVERRIDE { | 117 virtual views::View* GetContentsView() OVERRIDE { |
127 return login_view_; | 118 return login_view_; |
128 } | 119 } |
129 virtual views::Widget* GetWidget() OVERRIDE { | 120 virtual views::Widget* GetWidget() OVERRIDE { |
130 return login_view_->GetWidget(); | 121 return login_view_->GetWidget(); |
131 } | 122 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 views::Widget* dialog_; | 173 views::Widget* dialog_; |
183 | 174 |
184 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); | 175 DISALLOW_COPY_AND_ASSIGN(LoginHandlerViews); |
185 }; | 176 }; |
186 | 177 |
187 // static | 178 // static |
188 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 179 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
189 net::URLRequest* request) { | 180 net::URLRequest* request) { |
190 return new LoginHandlerViews(auth_info, request); | 181 return new LoginHandlerViews(auth_info, request); |
191 } | 182 } |
OLD | NEW |