| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/accelerator_table.h" | 5 #include "chrome/browser/ui/views/accelerator_table.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "printing/features/features.h" | 12 #include "printing/features/features.h" |
| 13 #include "ui/base/accelerators/accelerator.h" | 13 #include "ui/base/accelerators/accelerator.h" |
| 14 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
| 15 | 15 |
| 16 #if defined(USE_ASH) | 16 #if defined(USE_ASH) |
| 17 #include "ash/common/accelerators/accelerator_table.h" // nogncheck | 17 #include "ash/accelerators/accelerator_table.h" // nogncheck |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // For many commands, the Mac equivalent uses Cmd instead of Ctrl. We only need | 22 // For many commands, the Mac equivalent uses Cmd instead of Ctrl. We only need |
| 23 // to list the ones that do not have a key equivalent in the main menu, i.e. | 23 // to list the ones that do not have a key equivalent in the main menu, i.e. |
| 24 // only the ones in global_keyboard_shortcuts_mac.mm. | 24 // only the ones in global_keyboard_shortcuts_mac.mm. |
| 25 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
| 26 const ui::EventFlags kPlatformModifier = ui::EF_COMMAND_DOWN; | 26 const ui::EventFlags kPlatformModifier = ui::EF_COMMAND_DOWN; |
| 27 #else | 27 #else |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 return false; | 343 return false; |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool IsCommandRepeatable(int command_id) { | 346 bool IsCommandRepeatable(int command_id) { |
| 347 for (size_t i = 0; i < kRepeatableCommandIdsLength; ++i) { | 347 for (size_t i = 0; i < kRepeatableCommandIdsLength; ++i) { |
| 348 if (kRepeatableCommandIds[i] == command_id) | 348 if (kRepeatableCommandIds[i] == command_id) |
| 349 return true; | 349 return true; |
| 350 } | 350 } |
| 351 return false; | 351 return false; |
| 352 } | 352 } |
| OLD | NEW |