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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 14587007: Unify and change logout/sleep/lock shortcuts (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: exit warning Created 7 years, 7 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
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index f7a9ecba6754a227faa73cdc8cf3f3154a554106..945ac4cd2ed1ebfefcdeedc2726c76940c8e1075 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -10,6 +10,7 @@
#include <string>
#include "ash/accelerators/accelerator_table.h"
+#include "ash/accelerators/exit_warning_handler.h"
#include "ash/ash_switches.h"
#include "ash/caps_lock_delegate.h"
#include "ash/debug.h"
@@ -368,7 +369,8 @@ void AcceleratorControllerContext::UpdateContext(
// AcceleratorController, public:
AcceleratorController::AcceleratorController()
- : accelerator_manager_(new ui::AcceleratorManager) {
+ : accelerator_manager_(new ui::AcceleratorManager),
+ exit_warning_handler_(new ExitWarningHandler) {
sky 2013/05/13 15:40:32 If the lifetime of ExitWarningHandler is that of A
sschmitz 2013/05/14 16:49:11 Done.
Init();
}
@@ -574,8 +576,9 @@ bool AcceleratorController::PerformAction(int action,
case OPEN_FEEDBACK_PAGE:
ash::Shell::GetInstance()->delegate()->OpenFeedbackPage();
return true;
- case EXIT:
- Shell::GetInstance()->delegate()->Exit();
+ case EXIT_PRESSED:
+ case EXIT_RELEASED:
+ exit_warning_handler_->HandleExitKey(action == EXIT_PRESSED);
return true;
case NEW_INCOGNITO_WINDOW:
Shell::GetInstance()->delegate()->NewWindow(true /* is_incognito */);

Powered by Google App Engine
This is Rietveld 408576698