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

Unified Diff: chrome/browser/ui/ash/ash_util.cc

Issue 1177773002: Deprecating high-conflict accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moving IsDeprecated() to c/b/ui/ash Created 5 years, 6 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: chrome/browser/ui/ash/ash_util.cc
diff --git a/chrome/browser/ui/ash/ash_util.cc b/chrome/browser/ui/ash/ash_util.cc
index 3b72621e6afeb8b1d4cb34445cb304912b0ae17b..9b5016ea27214fc4c4c46adadf8cc9a1711c6b9d 100644
--- a/chrome/browser/ui/ash/ash_util.cc
+++ b/chrome/browser/ui/ash/ash_util.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/ash_util.h"
+#include "ash/accelerators/accelerator_controller.h"
#include "ash/shell.h"
#include "chrome/browser/ui/ash/ash_init.h"
#include "chrome/browser/ui/host_desktop.h"
@@ -50,4 +51,17 @@ bool IsNativeWindowInAsh(gfx::NativeWindow native_window) {
return IsNativeViewInAsh(native_window);
}
+bool IsAcceleratorDeprecated(const ui::Accelerator accelerator) {
+ if (!ash::Shell::HasInstance())
+ return false;
oshima 2015/06/19 21:21:45 this shouldn't be nullptr too.
afakhry 2015/06/19 22:14:19 Done. However there's a similar test for this case
+
+ ash::AcceleratorController* controller =
sky 2015/06/19 21:00:48 Do we really allow this to be null?
afakhry 2015/06/19 22:14:19 Done.
+ ash::Shell::GetInstance()->accelerator_controller();
+
+ if (!controller)
+ return false;
+
+ return controller->IsDeprecated(accelerator);
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698