| 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 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 : key_code_(keycode), | 43 : key_code_(keycode), |
| 44 type_(ui::ET_KEY_PRESSED), | 44 type_(ui::ET_KEY_PRESSED), |
| 45 modifiers_(modifiers), | 45 modifiers_(modifiers), |
| 46 is_repeat_(false) { | 46 is_repeat_(false) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 Accelerator::Accelerator(const KeyEvent& key_event) | 49 Accelerator::Accelerator(const KeyEvent& key_event) |
| 50 : key_code_(key_event.key_code()), | 50 : key_code_(key_event.key_code()), |
| 51 type_(key_event.type()), | 51 type_(key_event.type()), |
| 52 modifiers_(MaskOutKeyEventFlags(key_event.flags())), | 52 modifiers_(MaskOutKeyEventFlags(key_event.flags())), |
| 53 is_repeat_(key_event.IsRepeat()) { | 53 is_repeat_(key_event.is_repeat()) { |
| 54 } | 54 } |
| 55 | 55 |
| 56 Accelerator::Accelerator(const Accelerator& accelerator) { | 56 Accelerator::Accelerator(const Accelerator& accelerator) { |
| 57 key_code_ = accelerator.key_code_; | 57 key_code_ = accelerator.key_code_; |
| 58 type_ = accelerator.type_; | 58 type_ = accelerator.type_; |
| 59 modifiers_ = accelerator.modifiers_; | 59 modifiers_ = accelerator.modifiers_; |
| 60 is_repeat_ = accelerator.is_repeat_; | 60 is_repeat_ = accelerator.is_repeat_; |
| 61 if (accelerator.platform_accelerator_.get()) | 61 if (accelerator.platform_accelerator_.get()) |
| 62 platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy(); | 62 platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy(); |
| 63 } | 63 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 // Subtracting the size of the shortcut key and 1 for the '+' sign. | 291 // Subtracting the size of the shortcut key and 1 for the '+' sign. |
| 292 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); | 292 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); |
| 293 shortcut.swap(shortcut_rtl); | 293 shortcut.swap(shortcut_rtl); |
| 294 } | 294 } |
| 295 | 295 |
| 296 return shortcut; | 296 return shortcut; |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace ui | 299 } // namespace ui |
| OLD | NEW |