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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser/chromeos/input_method/input_method_engine.h" 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
6 6
7 #undef FocusIn 7 #undef FocusIn
8 #undef FocusOut 8 #undef FocusOut
9 #undef RootWindow 9 #undef RootWindow
10 #include <map> 10 #include <map>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 while (*s) { 65 while (*s) {
66 if ((*s & 0xC0) != 0x80) 66 if ((*s & 0xC0) != 0x80)
67 ret++; 67 ret++;
68 ++s; 68 ++s;
69 } 69 }
70 return ret; 70 return ret;
71 } 71 }
72 72
73 std::string GetKeyFromEvent(const ui::KeyEvent& event) { 73 std::string GetKeyFromEvent(const ui::KeyEvent& event) {
74 const std::string code = event.GetCodeString(); 74 const std::string code = event.GetCodeString();
75 if (StartsWithASCII(code, "Control", true)) 75 if (base::StartsWithASCII(code, "Control", true))
76 return "Ctrl"; 76 return "Ctrl";
77 if (StartsWithASCII(code, "Shift", true)) 77 if (base::StartsWithASCII(code, "Shift", true))
78 return "Shift"; 78 return "Shift";
79 if (StartsWithASCII(code, "Alt", true)) 79 if (base::StartsWithASCII(code, "Alt", true))
80 return "Alt"; 80 return "Alt";
81 if (StartsWithASCII(code, "Arrow", true)) 81 if (base::StartsWithASCII(code, "Arrow", true))
82 return code.substr(5); 82 return code.substr(5);
83 if (code == "Escape") 83 if (code == "Escape")
84 return "Esc"; 84 return "Esc";
85 if (code == "Backspace" || code == "Tab" || 85 if (code == "Backspace" || code == "Tab" ||
86 code == "Enter" || code == "CapsLock" || 86 code == "Enter" || code == "CapsLock" ||
87 code == "Power") 87 code == "Power")
88 return code; 88 return code;
89 // Cases for media keys. 89 // Cases for media keys.
90 switch (event.key_code()) { 90 switch (event.key_code()) {
91 case ui::VKEY_BROWSER_BACK: 91 case ui::VKEY_BROWSER_BACK:
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // TODO(nona): Implement it. 706 // TODO(nona): Implement it.
707 break; 707 break;
708 } 708 }
709 } 709 }
710 } 710 }
711 711
712 // TODO(nona): Support item.children. 712 // TODO(nona): Support item.children.
713 } 713 }
714 714
715 } // namespace chromeos 715 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_tasks.cc ('k') | chrome/browser/chromeos/input_method/input_method_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698