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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 601333002: ESC accelerator and consistent overview mode for Athena homecard (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: athena/wm/window_manager_impl.cc
diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc
index eb370c5aa47bed11222f5b038ebc7aac44de181d..04cd34643c5dd31b884b90aad87aa38b0f5da5ff 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -203,6 +203,10 @@ void WindowManagerImpl::SetInOverview(bool active) {
if (active == in_overview)
return;
+ const AcceleratorData esc_accelerator_data = {
+ TRIGGER_ON_PRESS, ui::VKEY_ESCAPE, ui::EF_NONE, CMD_EXIT_OVERVIEW,
+ AF_NONE};
+
bezel_controller_->set_left_right_delegate(
active ? NULL : split_view_controller_.get());
if (active) {
@@ -213,9 +217,12 @@ void WindowManagerImpl::SetInOverview(bool active) {
overview_ = WindowOverviewMode::Create(
container_.get(), window_list_provider_.get(),
split_view_controller_.get(), this);
+ AcceleratorManager::Get()->RegisterAccelerator(esc_accelerator_data, this);
} else {
overview_.reset();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeExit());
+ AcceleratorManager::Get()->UnregisterAccelerator(esc_accelerator_data,
+ this);
}
}
@@ -304,6 +311,9 @@ bool WindowManagerImpl::IsCommandEnabled(int command_id) const {
bool WindowManagerImpl::OnAcceleratorFired(int command_id,
const ui::Accelerator& accelerator) {
switch (command_id) {
+ case CMD_EXIT_OVERVIEW:
+ if (!IsOverviewModeActive())
+ break; // else fall through & Toggle
case CMD_TOGGLE_OVERVIEW:
ToggleOverview();
break;
« athena/input/public/accelerator_manager.h ('K') | « athena/wm/window_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698