| 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 "ui/base/accelerators/accelerator.h" | 5 #include "ui/base/accelerators/accelerator.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(TOOLKIT_GTK) | 9 #elif defined(TOOLKIT_GTK) |
| 10 #include <gdk/gdk.h> | 10 #include <gdk/gdk.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 | 25 |
| 26 Accelerator::Accelerator() | 26 Accelerator::Accelerator() |
| 27 : key_code_(ui::VKEY_UNKNOWN), | 27 : key_code_(ui::VKEY_UNKNOWN), |
| 28 type_(ui::ET_KEY_PRESSED), | 28 type_(ui::ET_KEY_PRESSED), |
| 29 modifiers_(0) { | 29 modifiers_(0) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 Accelerator::Accelerator(KeyboardCode keycode, int modifiers) | 32 Accelerator::Accelerator(KeyboardCode keycode, |
| 33 int modifiers, |
| 34 ui::EventType type) |
| 33 : key_code_(keycode), | 35 : key_code_(keycode), |
| 34 type_(ui::ET_KEY_PRESSED), | 36 type_(type), |
| 35 modifiers_(modifiers) { | 37 modifiers_(modifiers) { |
| 36 } | 38 } |
| 37 | 39 |
| 38 Accelerator::Accelerator(const Accelerator& accelerator) { | 40 Accelerator::Accelerator(const Accelerator& accelerator) { |
| 39 key_code_ = accelerator.key_code_; | 41 key_code_ = accelerator.key_code_; |
| 40 type_ = accelerator.type_; | 42 type_ = accelerator.type_; |
| 41 modifiers_ = accelerator.modifiers_; | 43 modifiers_ = accelerator.modifiers_; |
| 42 } | 44 } |
| 43 | 45 |
| 44 Accelerator::~Accelerator() { | 46 Accelerator::~Accelerator() { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 224 |
| 223 // Subtracting the size of the shortcut key and 1 for the '+' sign. | 225 // Subtracting the size of the shortcut key and 1 for the '+' sign. |
| 224 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); | 226 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); |
| 225 shortcut.swap(shortcut_rtl); | 227 shortcut.swap(shortcut_rtl); |
| 226 } | 228 } |
| 227 | 229 |
| 228 return shortcut; | 230 return shortcut; |
| 229 } | 231 } |
| 230 | 232 |
| 231 } // namespace ui | 233 } // namespace ui |
| OLD | NEW |