Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/test/chromedriver/keycode_text_conversion_mac.mm

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/test/chromedriver/keycode_text_conversion.h" 5 #include "chrome/test/chromedriver/keycode_text_conversion.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 base::string16 text16; 67 base::string16 text16;
68 text16.push_back(character); 68 text16.push_back(character);
69 *text = base::UTF16ToUTF8(text16); 69 *text = base::UTF16ToUTF8(text16);
70 return true; 70 return true;
71 } 71 }
72 *text = std::string(); 72 *text = std::string();
73 return true; 73 return true;
74 } 74 }
75 75
76 bool ConvertCharToKeyCode( 76 bool ConvertCharToKeyCode(
77 char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, 77 base::char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers,
78 std::string* error_msg) { 78 std::string* error_msg) {
79 base::string16 key_string; 79 base::string16 key_string;
80 key_string.push_back(key); 80 key_string.push_back(key);
81 std::string key_string_utf8 = base::UTF16ToUTF8(key_string); 81 std::string key_string_utf8 = base::UTF16ToUTF8(key_string);
82 bool found_code = false; 82 bool found_code = false;
83 *error_msg = std::string(); 83 *error_msg = std::string();
84 // There doesn't seem to be a way to get a mac key code for a given unicode 84 // There doesn't seem to be a way to get a mac key code for a given unicode
85 // character. So here we check every key code to see if it produces the 85 // character. So here we check every key code to see if it produces the
86 // right character. We could cache the results and regenerate everytime the 86 // right character. We could cache the results and regenerate everytime the
87 // language changes, but this brute force technique has negligble performance 87 // language changes, but this brute force technique has negligble performance
(...skipping 15 matching lines...) Expand all
103 *necessary_modifiers = kShiftKeyModifierMask; 103 *necessary_modifiers = kShiftKeyModifierMask;
104 found_code = true; 104 found_code = true;
105 } 105 }
106 if (found_code) { 106 if (found_code) {
107 *key_code = code; 107 *key_code = code;
108 break; 108 break;
109 } 109 }
110 } 110 }
111 return found_code; 111 return found_code;
112 } 112 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/keycode_text_conversion.h ('k') | chrome/test/chromedriver/keycode_text_conversion_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698