Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / accelerator_utils_aura.cc
blob199f8c4af8f6370af4e6dacd0e6b476e4d475c0d
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/ui/views/accelerator_table.h"
7 #include "ui/base/accelerators/accelerator.h"
9 #if defined(USE_ASH)
10 #include "ash/accelerators/accelerator_table.h"
11 #endif // USE_ASH
13 namespace chrome {
15 bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) {
16 #if defined(USE_ASH)
17 for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) {
18 const ash::AcceleratorData& accel_data = ash::kAcceleratorData[i];
19 if (accel_data.keycode == accelerator.key_code() &&
20 accel_data.modifiers == accelerator.modifiers()) {
21 return true;
24 #endif
26 std::vector<chrome::AcceleratorMapping> accelerators =
27 chrome::GetAcceleratorList();
28 for (std::vector<chrome::AcceleratorMapping>::const_iterator it =
29 accelerators.begin(); it != accelerators.end(); ++it) {
30 if (it->keycode == accelerator.key_code() &&
31 it->modifiers == accelerator.modifiers())
32 return true;
35 return false;
38 } // namespace chrome