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