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

Side by Side Diff: chrome/browser/ui/views/accelerator_utils_aura.cc

Issue 2166793005: Moves accelerator code using common types to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debug_commands
Patch Set: not relative 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/views/accelerator_table.h" 8 #include "chrome/browser/ui/views/accelerator_table.h"
9 #include "ui/base/accelerators/accelerator.h" 9 #include "ui/base/accelerators/accelerator.h"
10 10
11 #if defined(USE_ASH) 11 #if defined(USE_ASH)
12 #include "ash/accelerators/accelerator_table.h" 12 #include "ash/common/accelerators/accelerator_table.h"
13 #endif // USE_ASH 13 #endif // USE_ASH
14 14
15 namespace chrome { 15 namespace chrome {
16 16
17 bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) { 17 bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) {
18 #if defined(USE_ASH) 18 #if defined(USE_ASH)
19 for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) { 19 for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) {
20 const ash::AcceleratorData& accel_data = ash::kAcceleratorData[i]; 20 const ash::AcceleratorData& accel_data = ash::kAcceleratorData[i];
21 if (accel_data.keycode == accelerator.key_code() && 21 if (accel_data.keycode == accelerator.key_code() &&
22 accel_data.modifiers == accelerator.modifiers()) { 22 accel_data.modifiers == accelerator.modifiers()) {
(...skipping 30 matching lines...) Expand all
53 if (accelerators[i].command_id == command_id) { 53 if (accelerators[i].command_id == command_id) {
54 return ui::Accelerator(accelerators[i].keycode, 54 return ui::Accelerator(accelerators[i].keycode,
55 accelerators[i].modifiers); 55 accelerators[i].modifiers);
56 } 56 }
57 } 57 }
58 58
59 return ui::Accelerator(); 59 return ui::Accelerator();
60 } 60 }
61 61
62 } // namespace chrome 62 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/accelerator_table_unittest.cc ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698