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/chromeos/login/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/webui_login_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return GetWidget()->GetNativeView(); | 223 return GetWidget()->GetNativeView(); |
224 } | 224 } |
225 | 225 |
226 gfx::Point WebUILoginView::GetDialogPosition(const gfx::Size& size) { | 226 gfx::Point WebUILoginView::GetDialogPosition(const gfx::Size& size) { |
227 // Center the widget. | 227 // Center the widget. |
228 gfx::Size widget_size = GetWidget()->GetWindowBoundsInScreen().size(); | 228 gfx::Size widget_size = GetWidget()->GetWindowBoundsInScreen().size(); |
229 return gfx::Point(widget_size.width() / 2 - size.width() / 2, | 229 return gfx::Point(widget_size.width() / 2 - size.width() / 2, |
230 widget_size.height() / 2 - size.height() / 2); | 230 widget_size.height() / 2 - size.height() / 2); |
231 } | 231 } |
232 | 232 |
| 233 gfx::Size WebUILoginView::GetMaximumDialogSize() { |
| 234 return GetWidget()->GetWindowBoundsInScreen().size(); |
| 235 } |
| 236 |
233 void WebUILoginView::AddObserver( | 237 void WebUILoginView::AddObserver( |
234 web_modal::WebContentsModalDialogHostObserver* observer) { | 238 web_modal::WebContentsModalDialogHostObserver* observer) { |
235 if (observer && !observer_list_.HasObserver(observer)) | 239 if (observer && !observer_list_.HasObserver(observer)) |
236 observer_list_.AddObserver(observer); | 240 observer_list_.AddObserver(observer); |
237 } | 241 } |
238 | 242 |
239 void WebUILoginView::RemoveObserver( | 243 void WebUILoginView::RemoveObserver( |
240 web_modal::WebContentsModalDialogHostObserver* observer) { | 244 web_modal::WebContentsModalDialogHostObserver* observer) { |
241 observer_list_.RemoveObserver(observer); | 245 observer_list_.RemoveObserver(observer); |
242 } | 246 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 login_prompt_visible_handled_ = true; | 451 login_prompt_visible_handled_ = true; |
448 } | 452 } |
449 | 453 |
450 void WebUILoginView::ReturnFocus(bool reverse) { | 454 void WebUILoginView::ReturnFocus(bool reverse) { |
451 // Return the focus to the web contents. | 455 // Return the focus to the web contents. |
452 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 456 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
453 GetWidget()->Activate(); | 457 GetWidget()->Activate(); |
454 } | 458 } |
455 | 459 |
456 } // namespace chromeos | 460 } // namespace chromeos |
OLD | NEW |