Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 1390003: add keyboard acclerators to login wizard... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix compile errors Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/wizard_controller.cc
===================================================================
--- chrome/browser/chromeos/login/wizard_controller.cc (revision 42821)
+++ chrome/browser/chromeos/login/wizard_controller.cc (working copy)
@@ -26,6 +26,7 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/wm_ipc.h"
#include "chrome/common/chrome_switches.h"
+#include "views/accelerator.h"
#include "views/painter.h"
#include "views/screen.h"
#include "views/view.h"
@@ -45,13 +46,28 @@
: window_x_(window_x),
window_y_(window_y),
screen_w_(screen_w),
- screen_h_(screen_h) {
+ screen_h_(screen_h),
+ accel_login_screen_(views::Accelerator(base::VKEY_L,
+ false, true, true)) {
if (paint_background) {
painter_.reset(chromeos::CreateWizardPainter(
&chromeos::BorderDefinition::kWizardBorder));
}
+
+ AddAccelerator(accel_login_screen_);
}
+ bool AcceleratorPressed(const views::Accelerator& accel) {
+ if (accel == accel_login_screen_) {
+ WizardController *controller = WizardController::default_controller();
+ if (controller)
+ controller->ShowFirstScreen(WizardController::kLoginScreenName);
+ return true;
+ }
+
+ return false;
+ }
+
void PaintBackground(gfx::Canvas* canvas) {
if (painter_.get()) {
// TODO(sky): nuke this once new login manager is in place. This needs to
@@ -78,6 +94,8 @@
const int screen_w_;
const int screen_h_;
+ views::Accelerator accel_login_screen_;
+
DISALLOW_COPY_AND_ASSIGN(ContentView);
};
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698