| 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/extensions/key_identifier_conversion_views.h" | 5 #include "chrome/browser/extensions/key_identifier_conversion_views.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "ui/base/event.h" | 15 #include "ui/base/events/event.h" |
| 16 #include "ui/base/keycodes/keyboard_codes.h" | 16 #include "ui/base/keycodes/keyboard_codes.h" |
| 17 | 17 |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 static const int kNumIdentifierTypes = 3; | 22 static const int kNumIdentifierTypes = 3; |
| 23 | 23 |
| 24 typedef struct KeyIdentifier { | 24 typedef struct KeyIdentifier { |
| 25 // In order: key identifier, character and unicode codepoint. They are | 25 // In order: key identifier, character and unicode codepoint. They are |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 for (int i = 0; i < kNumIdentifierTypes; ++i) { | 331 for (int i = 0; i < kNumIdentifierTypes; ++i) { |
| 332 const IdentifierMap& map = *identifierMaps[i]; | 332 const IdentifierMap& map = *identifierMaps[i]; |
| 333 | 333 |
| 334 IdentifierMap::const_iterator iter = map.find(key_identifier); | 334 IdentifierMap::const_iterator iter = map.find(key_identifier); |
| 335 if (iter != map.end()) | 335 if (iter != map.end()) |
| 336 return *iter->second; | 336 return *iter->second; |
| 337 } | 337 } |
| 338 | 338 |
| 339 return *kUnknownKeyEvent; | 339 return *kUnknownKeyEvent; |
| 340 } | 340 } |
| OLD | NEW |