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"
10 #include "ash/accelerators/accelerator_table.h"
15 bool IsChromeAccelerator(const ui::Accelerator
& accelerator
, Profile
* profile
) {
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()) {
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())