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

Unified Diff: chrome/browser/ui/gtk/accelerator_utils_gtk.cc

Issue 13044014: Make sure manifest specified shortcut for Extension Command can not override the built-in shortcuts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for ChromeOS (ash) Created 7 years, 8 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/gtk/accelerator_utils_gtk.cc
diff --git a/chrome/browser/ui/gtk/accelerator_utils_gtk.cc b/chrome/browser/ui/gtk/accelerator_utils_gtk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0a83cdf0eb1176ec88ad5787cd31ad35369e43ff
--- /dev/null
+++ b/chrome/browser/ui/gtk/accelerator_utils_gtk.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/gtk/accelerators_gtk.h"
+#include "ui/base/accelerators/accelerator.h"
+
+namespace chrome {
+
+bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) {
+ AcceleratorsGtk* accelerators = AcceleratorsGtk::GetInstance();
+ for (AcceleratorsGtk::const_iterator iter = accelerators->begin();
+ iter != accelerators->end(); ++iter) {
+ if (iter->second.key_code() == accelerator.key_code() &&
+ iter->second.modifiers() == accelerator.modifiers())
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698