| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/keymap.h" | 5 #include "chrome/test/webdriver/keymap.h" |
| 6 | 6 |
| 7 #include "chrome/browser/automation/ui_controls.h" | 7 #include "chrome/browser/automation/ui_controls.h" |
| 8 #include "views/events/event.h" | 8 #include "views/events/event.h" |
| 9 | 9 |
| 10 namespace webdriver { | 10 namespace webdriver { |
| 11 | 11 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 shifted_keys_[L'#'] = ui::VKEY_3; | 111 shifted_keys_[L'#'] = ui::VKEY_3; |
| 112 shifted_keys_[L'$'] = ui::VKEY_4; | 112 shifted_keys_[L'$'] = ui::VKEY_4; |
| 113 shifted_keys_[L'%'] = ui::VKEY_5; | 113 shifted_keys_[L'%'] = ui::VKEY_5; |
| 114 shifted_keys_[L'^'] = ui::VKEY_6; | 114 shifted_keys_[L'^'] = ui::VKEY_6; |
| 115 shifted_keys_[L'&'] = ui::VKEY_7; | 115 shifted_keys_[L'&'] = ui::VKEY_7; |
| 116 shifted_keys_[L'*'] = ui::VKEY_8; | 116 shifted_keys_[L'*'] = ui::VKEY_8; |
| 117 shifted_keys_[L'('] = ui::VKEY_9; | 117 shifted_keys_[L'('] = ui::VKEY_9; |
| 118 shifted_keys_[L')'] = ui::VKEY_0; | 118 shifted_keys_[L')'] = ui::VKEY_0; |
| 119 } | 119 } |
| 120 | 120 |
| 121 KeyMap::~KeyMap() {} |
| 122 |
| 121 ui::KeyboardCode KeyMap::Get(const wchar_t& key) const { | 123 ui::KeyboardCode KeyMap::Get(const wchar_t& key) const { |
| 122 std::map<wchar_t, ui::KeyboardCode>::const_iterator it; | 124 std::map<wchar_t, ui::KeyboardCode>::const_iterator it; |
| 123 it = keys_.find(key); | 125 it = keys_.find(key); |
| 124 if (it == keys_.end()) { | 126 if (it == keys_.end()) { |
| 125 it = shifted_keys_.find(key); | 127 it = shifted_keys_.find(key); |
| 126 if (it == shifted_keys_.end()) { | 128 if (it == shifted_keys_.end()) { |
| 127 return ui::VKEY_UNKNOWN; | 129 return ui::VKEY_UNKNOWN; |
| 128 } | 130 } |
| 129 } | 131 } |
| 130 return it->second; | 132 return it->second; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 168 |
| 167 void KeyMap::ClearModifiers() { | 169 void KeyMap::ClearModifiers() { |
| 168 shift_ = false; | 170 shift_ = false; |
| 169 alt_ = false; | 171 alt_ = false; |
| 170 control_ = false; | 172 control_ = false; |
| 171 command_ = false; | 173 command_ = false; |
| 172 } | 174 } |
| 173 | 175 |
| 174 } // namespace webdriver | 176 } // namespace webdriver |
| 175 | 177 |
| OLD | NEW |