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

Side by Side Diff: chrome/test/webdriver/keycode_text_conversion_gtk.cc

Issue 16753002: Use a direct include of strings headers in chrome/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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) 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/test/webdriver/keycode_text_conversion.h" 5 #include "chrome/test/webdriver/keycode_text_conversion.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #include "base/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/common/automation_constants.h" 11 #include "chrome/common/automation_constants.h"
12 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" 12 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
13 13
14 namespace webdriver { 14 namespace webdriver {
15 15
16 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { 16 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) {
17 // |gdk_keyval_to_upper| does not convert some keys like '1' to '!', so 17 // |gdk_keyval_to_upper| does not convert some keys like '1' to '!', so
18 // provide |ui::GdkKeyCodeForWindowsKeyCode| with our shift state as well, 18 // provide |ui::GdkKeyCodeForWindowsKeyCode| with our shift state as well,
19 // which will do basic conversions like it for us. 19 // which will do basic conversions like it for us.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 if (is_special_symbol || key_utf32 != g_unichar_tolower(key_utf32)) 58 if (is_special_symbol || key_utf32 != g_unichar_tolower(key_utf32))
59 *necessary_modifiers = automation::kShiftKeyMask; 59 *necessary_modifiers = automation::kShiftKeyMask;
60 ui::KeyboardCode code = ui::WindowsKeyCodeForGdkKeyCode(gdk_key_code); 60 ui::KeyboardCode code = ui::WindowsKeyCodeForGdkKeyCode(gdk_key_code);
61 if (code != ui::VKEY_UNKNOWN) 61 if (code != ui::VKEY_UNKNOWN)
62 *key_code = code; 62 *key_code = code;
63 return code != ui::VKEY_UNKNOWN; 63 return code != ui::VKEY_UNKNOWN;
64 } 64 }
65 65
66 } // namespace webdriver 66 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/keycode_text_conversion.h ('k') | chrome/test/webdriver/keycode_text_conversion_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698