| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED, | 121 chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED, |
| 122 content::NotificationService::AllSources()); | 122 content::NotificationService::AllSources()); |
| 123 registrar_.Add(this, | 123 registrar_.Add(this, |
| 124 chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN, | 124 chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN, |
| 125 content::NotificationService::AllSources()); | 125 content::NotificationService::AllSources()); |
| 126 registrar_.Add(this, | 126 registrar_.Add(this, |
| 127 chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN, | 127 chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN, |
| 128 content::NotificationService::AllSources()); | 128 content::NotificationService::AllSources()); |
| 129 | 129 |
| 130 accel_map_[ui::Accelerator(ui::VKEY_Z, | 130 accel_map_[ui::Accelerator(ui::VKEY_Z, |
| 131 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = | 131 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, |
| 132 ui::ET_KEY_PRESSED)] = |
| 132 kAccelNameAccessibility; | 133 kAccelNameAccessibility; |
| 133 accel_map_[ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)] = | 134 accel_map_[ui::Accelerator(ui::VKEY_ESCAPE, |
| 135 ui::EF_NONE, |
| 136 ui::ET_KEY_PRESSED)] = |
| 134 kAccelNameCancel; | 137 kAccelNameCancel; |
| 135 accel_map_[ui::Accelerator(ui::VKEY_E, | 138 accel_map_[ui::Accelerator(ui::VKEY_E, |
| 136 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = | 139 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, |
| 140 ui::ET_KEY_PRESSED)] = |
| 137 kAccelNameEnrollment; | 141 kAccelNameEnrollment; |
| 138 // This should be kept in sync with the IDC_EXIT accelerator. | 142 // This should be kept in sync with the IDC_EXIT accelerator. |
| 139 accel_map_[ui::Accelerator(ui::VKEY_Q, | 143 accel_map_[ui::Accelerator(ui::VKEY_Q, |
| 140 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN)] = | 144 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
| 145 ui::ET_KEY_PRESSED)] = |
| 141 kAccelNameExit; | 146 kAccelNameExit; |
| 142 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] = | 147 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN, ui::ET_KEY_PRESSED)] = |
| 143 kAccelNameVersion; | 148 kAccelNameVersion; |
| 144 | 149 |
| 145 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) | 150 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) |
| 146 AddAccelerator(i->first); | 151 AddAccelerator(i->first); |
| 147 } | 152 } |
| 148 | 153 |
| 149 WebUILoginView::~WebUILoginView() { | 154 WebUILoginView::~WebUILoginView() { |
| 150 ash::SystemTray* tray = ash::Shell::GetInstance()->tray(); | 155 ash::SystemTray* tray = ash::Shell::GetInstance()->tray(); |
| 151 if (tray) | 156 if (tray) |
| 152 tray->SetNextFocusableView(NULL); | 157 tray->SetNextFocusableView(NULL); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 return true; | 342 return true; |
| 338 } | 343 } |
| 339 | 344 |
| 340 void WebUILoginView::ReturnFocus(bool reverse) { | 345 void WebUILoginView::ReturnFocus(bool reverse) { |
| 341 // Return the focus to the web contents. | 346 // Return the focus to the web contents. |
| 342 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 347 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 343 GetWidget()->Activate(); | 348 GetWidget()->Activate(); |
| 344 } | 349 } |
| 345 | 350 |
| 346 } // namespace chromeos | 351 } // namespace chromeos |
| OLD | NEW |