OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/braille_display_private/brlapi_keycode_m
ap.h" | 5 #include "chrome/browser/extensions/api/braille_display_private/brlapi_keycode_m
ap.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversion_utils.h" | 10 #include "base/strings/utf_string_conversion_utils.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 event->command = KEY_COMMAND_DOTS; | 145 event->command = KEY_COMMAND_DOTS; |
146 event->braille_dots.reset(new int(argument & kAllDots)); | 146 event->braille_dots.reset(new int(argument & kAllDots)); |
147 MapModifierFlags(code, event); | 147 MapModifierFlags(code, event); |
148 break; | 148 break; |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 } // namespace | 153 } // namespace |
154 | 154 |
155 scoped_ptr<KeyEvent> BrlapiKeyCodeToEvent(brlapi_keyCode_t code) { | 155 std::unique_ptr<KeyEvent> BrlapiKeyCodeToEvent(brlapi_keyCode_t code) { |
156 scoped_ptr<KeyEvent> result(new KeyEvent); | 156 std::unique_ptr<KeyEvent> result(new KeyEvent); |
157 result->command = KEY_COMMAND_NONE; | 157 result->command = KEY_COMMAND_NONE; |
158 switch (code & BRLAPI_KEY_TYPE_MASK) { | 158 switch (code & BRLAPI_KEY_TYPE_MASK) { |
159 case BRLAPI_KEY_TYPE_SYM: | 159 case BRLAPI_KEY_TYPE_SYM: |
160 MapKeySym(code, result.get()); | 160 MapKeySym(code, result.get()); |
161 break; | 161 break; |
162 case BRLAPI_KEY_TYPE_CMD: | 162 case BRLAPI_KEY_TYPE_CMD: |
163 MapCommand(code, result.get()); | 163 MapCommand(code, result.get()); |
164 break; | 164 break; |
165 } | 165 } |
166 if (result->command == KEY_COMMAND_NONE) | 166 if (result->command == KEY_COMMAND_NONE) |
167 result.reset(); | 167 result.reset(); |
168 return result; | 168 return result; |
169 } | 169 } |
170 | 170 |
171 } // namespace braille_display_private | 171 } // namespace braille_display_private |
172 } // namespace api | 172 } // namespace api |
173 } // namespace extensions | 173 } // namespace extensions |
OLD | NEW |