| OLD | NEW |
| 1 // Copyright (c) 2011 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 "ui/base/events.h" | 8 #include "ui/base/events.h" |
| 9 | 9 |
| 10 namespace webdriver { | 10 namespace webdriver { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (shift_ || shifted_keys_.find(key) != shifted_keys_.end()) { | 149 if (shift_ || shifted_keys_.find(key) != shifted_keys_.end()) { |
| 150 modifiers = modifiers | ui::EF_SHIFT_DOWN; | 150 modifiers = modifiers | ui::EF_SHIFT_DOWN; |
| 151 } | 151 } |
| 152 if (control_) { | 152 if (control_) { |
| 153 modifiers = modifiers | ui::EF_CONTROL_DOWN; | 153 modifiers = modifiers | ui::EF_CONTROL_DOWN; |
| 154 } | 154 } |
| 155 if (alt_) { | 155 if (alt_) { |
| 156 modifiers = modifiers | ui::EF_ALT_DOWN; | 156 modifiers = modifiers | ui::EF_ALT_DOWN; |
| 157 } | 157 } |
| 158 if (command_) { | 158 if (command_) { |
| 159 VLOG(1) << "Pressing command key on linux!!"; | 159 LOG(INFO) << "Pressing command key on linux!!"; |
| 160 modifiers = modifiers | ui::EF_COMMAND_DOWN; | 160 modifiers = modifiers | ui::EF_COMMAND_DOWN; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // TODO(jmikhail): need to be able to capture modifier key up. | 163 // TODO(jmikhail): need to be able to capture modifier key up. |
| 164 window->SimulateOSKeyPress(key_code, modifiers); | 164 window->SimulateOSKeyPress(key_code, modifiers); |
| 165 | 165 |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void KeyMap::ClearModifiers() { | 169 void KeyMap::ClearModifiers() { |
| 170 shift_ = false; | 170 shift_ = false; |
| 171 alt_ = false; | 171 alt_ = false; |
| 172 control_ = false; | 172 control_ = false; |
| 173 command_ = false; | 173 command_ = false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace webdriver | 176 } // namespace webdriver |
| 177 | 177 |
| OLD | NEW |