| 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 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
| 28 #include "chrome/common/render_messages.h" | 28 #include "chrome/common/render_messages.h" |
| 29 #include "chromeos/dbus/dbus_thread_manager.h" | 29 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "chromeos/dbus/session_manager_client.h" | 30 #include "chromeos/dbus/session_manager_client.h" |
| 31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "content/public/browser/render_view_host.h" | 32 #include "content/public/browser/render_view_host.h" |
| 33 #include "content/public/browser/render_view_host_observer.h" | 33 #include "content/public/browser/render_view_host_observer.h" |
| 34 #include "content/public/browser/render_widget_host_view.h" | 34 #include "content/public/browser/render_widget_host_view.h" |
| 35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/browser/web_contents_view.h" |
| 36 #include "content/public/browser/web_ui.h" | 37 #include "content/public/browser/web_ui.h" |
| 37 #include "ui/aura/env.h" | 38 #include "ui/aura/env.h" |
| 38 #include "ui/gfx/rect.h" | 39 #include "ui/gfx/rect.h" |
| 39 #include "ui/gfx/size.h" | 40 #include "ui/gfx/size.h" |
| 40 #include "ui/views/controls/webview/webview.h" | 41 #include "ui/views/controls/webview/webview.h" |
| 41 #include "ui/views/widget/widget.h" | 42 #include "ui/views/widget/widget.h" |
| 42 | 43 |
| 43 using content::NativeWebKeyboardEvent; | 44 using content::NativeWebKeyboardEvent; |
| 44 using content::RenderViewHost; | 45 using content::RenderViewHost; |
| 45 using content::WebContents; | 46 using content::WebContents; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 270 |
| 270 void WebUILoginView::ChildPreferredSizeChanged(View* child) { | 271 void WebUILoginView::ChildPreferredSizeChanged(View* child) { |
| 271 Layout(); | 272 Layout(); |
| 272 SchedulePaint(); | 273 SchedulePaint(); |
| 273 } | 274 } |
| 274 | 275 |
| 275 void WebUILoginView::AboutToRequestFocusFromTabTraversal(bool reverse) { | 276 void WebUILoginView::AboutToRequestFocusFromTabTraversal(bool reverse) { |
| 276 // Return the focus to the web contents. | 277 // Return the focus to the web contents. |
| 277 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 278 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 278 GetWidget()->Activate(); | 279 GetWidget()->Activate(); |
| 279 webui_login_->web_contents()->Focus(); | 280 webui_login_->web_contents()->GetView()->Focus(); |
| 280 } | 281 } |
| 281 | 282 |
| 282 void WebUILoginView::Observe(int type, | 283 void WebUILoginView::Observe(int type, |
| 283 const content::NotificationSource& source, | 284 const content::NotificationSource& source, |
| 284 const content::NotificationDetails& details) { | 285 const content::NotificationDetails& details) { |
| 285 switch (type) { | 286 switch (type) { |
| 286 case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: { | 287 case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: { |
| 287 OnLoginPromptVisible(); | 288 OnLoginPromptVisible(); |
| 288 registrar_.RemoveAll(); | 289 registrar_.RemoveAll(); |
| 289 break; | 290 break; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 aura::Env::GetInstance()->set_render_white_bg(true); | 376 aura::Env::GetInstance()->set_render_white_bg(true); |
| 376 } | 377 } |
| 377 | 378 |
| 378 void WebUILoginView::ReturnFocus(bool reverse) { | 379 void WebUILoginView::ReturnFocus(bool reverse) { |
| 379 // Return the focus to the web contents. | 380 // Return the focus to the web contents. |
| 380 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 381 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 381 GetWidget()->Activate(); | 382 GetWidget()->Activate(); |
| 382 } | 383 } |
| 383 | 384 |
| 384 } // namespace chromeos | 385 } // namespace chromeos |
| OLD | NEW |