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

Unified Diff: ash/accelerators/accelerator_delegate.cc

Issue 2170753005: Moves AcceleratorController from Shell to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 5 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 | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accelerators/focus_manager_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_delegate.cc
diff --git a/ash/accelerators/accelerator_delegate.cc b/ash/accelerators/accelerator_delegate.cc
index eacf1362289457eab1fe7d6510fa71bdd6c47082..db8024f1cd3ce2a5e4355acee3f660b60eda8283 100644
--- a/ash/accelerators/accelerator_delegate.cc
+++ b/ash/accelerators/accelerator_delegate.cc
@@ -54,12 +54,12 @@ bool AcceleratorDelegate::ProcessAccelerator(
if (IsSystemKey(key_event.key_code()) && !CanConsumeSystemKeys(key_event)) {
// System keys are always consumed regardless of whether they trigger an
// accelerator to prevent windows from seeing unexpected key up events.
- Shell::GetInstance()->accelerator_controller()->Process(accelerator);
+ WmShell::Get()->accelerator_controller()->Process(accelerator);
return true;
}
if (!ShouldProcessAcceleratorNow(key_event, accelerator))
return false;
- return Shell::GetInstance()->accelerator_controller()->Process(accelerator);
+ return WmShell::Get()->accelerator_controller()->Process(accelerator);
}
// Uses the top level window so if the target is a web contents window the
@@ -90,10 +90,11 @@ bool AcceleratorDelegate::ShouldProcessAcceleratorNow(
return true;
aura::Window* top_level = ::wm::GetToplevelWindow(target);
- Shell* shell = Shell::GetInstance();
+ AcceleratorController* accelerator_controller =
+ WmShell::Get()->accelerator_controller();
// Reserved accelerators (such as Power button) always have a prority.
- if (shell->accelerator_controller()->IsReserved(accelerator))
+ if (accelerator_controller->IsReserved(accelerator))
return true;
// A full screen window has a right to handle all key events including the
@@ -107,7 +108,7 @@ bool AcceleratorDelegate::ShouldProcessAcceleratorNow(
// Handle preferred accelerators (such as ALT-TAB) before sending
// to the target.
- if (shell->accelerator_controller()->IsPreferred(accelerator))
+ if (accelerator_controller->IsPreferred(accelerator))
return true;
return WmShell::Get()->GetAppListTargetVisibility();
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accelerators/focus_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698