| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #if defined(TOOLKIT_USES_GTK) | 33 #if defined(TOOLKIT_USES_GTK) |
| 34 #include "chrome/browser/chromeos/wm_ipc.h" | 34 #include "chrome/browser/chromeos/wm_ipc.h" |
| 35 #include "views/widget/native_widget_gtk.h" | 35 #include "views/widget/native_widget_gtk.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(USE_VIRTUAL_KEYBOARD) | 38 #if defined(USE_VIRTUAL_KEYBOARD) |
| 39 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" | 39 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 #if defined(TOUCH_UI) |
| 43 #include "chrome/browser/ui/touch/sensors/screen_orientation_listener.h" |
| 44 #endif |
| 45 |
| 42 namespace { | 46 namespace { |
| 43 | 47 |
| 44 const char kViewClassName[] = "browser/chromeos/login/WebUILoginView"; | 48 const char kViewClassName[] = "browser/chromeos/login/WebUILoginView"; |
| 45 | 49 |
| 46 // These strings must be kept in sync with handleAccelerator() in oobe.js. | 50 // These strings must be kept in sync with handleAccelerator() in oobe.js. |
| 47 const char kAccelNameAccessibility[] = "accessibility"; | 51 const char kAccelNameAccessibility[] = "accessibility"; |
| 48 const char kAccelNameCancel[] = "cancel"; | 52 const char kAccelNameCancel[] = "cancel"; |
| 49 const char kAccelNameEnrollment[] = "enrollment"; | 53 const char kAccelNameEnrollment[] = "enrollment"; |
| 50 | 54 |
| 51 // Observes IPC messages from the FrameSniffer and notifies JS if error | 55 // Observes IPC messages from the FrameSniffer and notifies JS if error |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 : status_area_(NULL), | 118 : status_area_(NULL), |
| 115 webui_login_(NULL), | 119 webui_login_(NULL), |
| 116 login_window_(NULL), | 120 login_window_(NULL), |
| 117 status_window_(NULL), | 121 status_window_(NULL), |
| 118 host_window_frozen_(false), | 122 host_window_frozen_(false), |
| 119 status_area_visibility_on_init_(true) { | 123 status_area_visibility_on_init_(true) { |
| 120 #if defined(USE_VIRTUAL_KEYBOARD) | 124 #if defined(USE_VIRTUAL_KEYBOARD) |
| 121 // Make sure the singleton VirtualKeyboardManager object is created. | 125 // Make sure the singleton VirtualKeyboardManager object is created. |
| 122 VirtualKeyboardManager::GetInstance(); | 126 VirtualKeyboardManager::GetInstance(); |
| 123 #endif | 127 #endif |
| 128 |
| 129 #if defined(TOUCH_UI) |
| 130 // Make sure the singleton ScreenOrientationListener object is created. |
| 131 ScreenOrientationListener::GetInstance(); |
| 132 #endif |
| 133 |
| 124 accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] = | 134 accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] = |
| 125 kAccelNameAccessibility; | 135 kAccelNameAccessibility; |
| 126 accel_map_[views::Accelerator(ui::VKEY_ESCAPE, false, false, false)] = | 136 accel_map_[views::Accelerator(ui::VKEY_ESCAPE, false, false, false)] = |
| 127 kAccelNameCancel; | 137 kAccelNameCancel; |
| 128 accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] = | 138 accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] = |
| 129 kAccelNameEnrollment; | 139 kAccelNameEnrollment; |
| 130 | 140 |
| 131 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) | 141 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) |
| 132 AddAccelerator(i->first); | 142 AddAccelerator(i->first); |
| 133 } | 143 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 GetFocusManager()); | 426 GetFocusManager()); |
| 417 | 427 |
| 418 // Make sure error bubble is cleared on keyboard event. This is needed | 428 // Make sure error bubble is cleared on keyboard event. This is needed |
| 419 // when the focus is inside an iframe. | 429 // when the focus is inside an iframe. |
| 420 WebUI* web_ui = GetWebUI(); | 430 WebUI* web_ui = GetWebUI(); |
| 421 if (web_ui) | 431 if (web_ui) |
| 422 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); | 432 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); |
| 423 } | 433 } |
| 424 | 434 |
| 425 } // namespace chromeos | 435 } // namespace chromeos |
| OLD | NEW |