| 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 30 matching lines...) Expand all Loading... |
| 41 #include "ui/views/controls/webview/webview.h" | 41 #include "ui/views/controls/webview/webview.h" |
| 42 #include "ui/views/widget/widget.h" | 42 #include "ui/views/widget/widget.h" |
| 43 | 43 |
| 44 using content::NativeWebKeyboardEvent; | 44 using content::NativeWebKeyboardEvent; |
| 45 using content::RenderViewHost; | 45 using content::RenderViewHost; |
| 46 using content::WebContents; | 46 using content::WebContents; |
| 47 using web_modal::WebContentsModalDialogManager; | 47 using web_modal::WebContentsModalDialogManager; |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| 51 // These strings must be kept in sync with handleAccelerator() in oobe.js. | 51 // These strings must be kept in sync with handleAccelerator() |
| 52 // in display_manager.js. |
| 52 const char kAccelNameCancel[] = "cancel"; | 53 const char kAccelNameCancel[] = "cancel"; |
| 53 const char kAccelNameEnrollment[] = "enrollment"; | 54 const char kAccelNameEnrollment[] = "enrollment"; |
| 54 const char kAccelNameKioskEnable[] = "kiosk_enable"; | 55 const char kAccelNameKioskEnable[] = "kiosk_enable"; |
| 55 const char kAccelNameVersion[] = "version"; | 56 const char kAccelNameVersion[] = "version"; |
| 56 const char kAccelNameReset[] = "reset"; | 57 const char kAccelNameReset[] = "reset"; |
| 57 const char kAccelNameLeft[] = "left"; | 58 const char kAccelNameLeft[] = "left"; |
| 58 const char kAccelNameRight[] = "right"; | 59 const char kAccelNameRight[] = "right"; |
| 59 const char kAccelNameDeviceRequisition[] = "device_requisition"; | 60 const char kAccelNameDeviceRequisition[] = "device_requisition"; |
| 60 const char kAccelNameDeviceRequisitionRemora[] = "device_requisition_remora"; | 61 const char kAccelNameDeviceRequisitionRemora[] = "device_requisition_remora"; |
| 62 const char kAccelNameAppLaunchBailout[] = "app_launch_bailout"; |
| 61 | 63 |
| 62 // Observes IPC messages from the FrameSniffer and notifies JS if error | 64 // Observes IPC messages from the FrameSniffer and notifies JS if error |
| 63 // appears. | 65 // appears. |
| 64 class SnifferObserver : public content::RenderViewHostObserver { | 66 class SnifferObserver : public content::RenderViewHostObserver { |
| 65 public: | 67 public: |
| 66 SnifferObserver(RenderViewHost* host, content::WebUI* webui) | 68 SnifferObserver(RenderViewHost* host, content::WebUI* webui) |
| 67 : content::RenderViewHostObserver(host), webui_(webui) { | 69 : content::RenderViewHostObserver(host), webui_(webui) { |
| 68 DCHECK(webui_); | 70 DCHECK(webui_); |
| 69 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(), | 71 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(), |
| 70 UTF8ToUTF16("gaia-frame"))); | 72 UTF8ToUTF16("gaia-frame"))); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 accel_map_[ui::Accelerator(ui::VKEY_RIGHT, ui::EF_NONE)] = | 178 accel_map_[ui::Accelerator(ui::VKEY_RIGHT, ui::EF_NONE)] = |
| 177 kAccelNameRight; | 179 kAccelNameRight; |
| 178 | 180 |
| 179 accel_map_[ui::Accelerator( | 181 accel_map_[ui::Accelerator( |
| 180 ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = | 182 ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = |
| 181 kAccelNameDeviceRequisition; | 183 kAccelNameDeviceRequisition; |
| 182 accel_map_[ | 184 accel_map_[ |
| 183 ui::Accelerator(ui::VKEY_H, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = | 185 ui::Accelerator(ui::VKEY_H, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = |
| 184 kAccelNameDeviceRequisitionRemora; | 186 kAccelNameDeviceRequisitionRemora; |
| 185 | 187 |
| 188 accel_map_[ui::Accelerator(ui::VKEY_S, |
| 189 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = |
| 190 kAccelNameAppLaunchBailout; |
| 191 |
| 186 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) | 192 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) |
| 187 AddAccelerator(i->first); | 193 AddAccelerator(i->first); |
| 188 } | 194 } |
| 189 | 195 |
| 190 WebUILoginView::~WebUILoginView() { | 196 WebUILoginView::~WebUILoginView() { |
| 191 if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) { | 197 if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) { |
| 192 ash::Shell::GetInstance()->GetPrimarySystemTray()-> | 198 ash::Shell::GetInstance()->GetPrimarySystemTray()-> |
| 193 SetNextFocusableView(NULL); | 199 SetNextFocusableView(NULL); |
| 194 } | 200 } |
| 195 } | 201 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 login_prompt_visible_handled_ = true; | 473 login_prompt_visible_handled_ = true; |
| 468 } | 474 } |
| 469 | 475 |
| 470 void WebUILoginView::ReturnFocus(bool reverse) { | 476 void WebUILoginView::ReturnFocus(bool reverse) { |
| 471 // Return the focus to the web contents. | 477 // Return the focus to the web contents. |
| 472 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 478 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 473 GetWidget()->Activate(); | 479 GetWidget()->Activate(); |
| 474 } | 480 } |
| 475 | 481 |
| 476 } // namespace chromeos | 482 } // namespace chromeos |
| OLD | NEW |