| OLD | NEW |
| 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 "ash/sticky_keys/sticky_keys_controller.h" | 5 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 6 | 6 |
| 7 #include "ash/sticky_keys/sticky_keys_overlay.h" | 7 #include "ash/sticky_keys/sticky_keys_overlay.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_tracker.h" | 10 #include "ui/aura/window_tracker.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 return false; | 288 return false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 int StickyKeysHandler::GetModifierUpEvent( | 291 int StickyKeysHandler::GetModifierUpEvent( |
| 292 std::unique_ptr<ui::Event>* new_event) { | 292 std::unique_ptr<ui::Event>* new_event) { |
| 293 if (current_state_ != STICKY_KEY_STATE_DISABLED || !modifier_up_event_) | 293 if (current_state_ != STICKY_KEY_STATE_DISABLED || !modifier_up_event_) |
| 294 return 0; | 294 return 0; |
| 295 DCHECK(new_event); | 295 DCHECK(new_event); |
| 296 if (*new_event) | 296 if (*new_event) |
| 297 return 1; | 297 return 1; |
| 298 new_event->reset(modifier_up_event_.release()); | 298 *new_event = std::move(modifier_up_event_); |
| 299 return 0; | 299 return 0; |
| 300 } | 300 } |
| 301 | 301 |
| 302 StickyKeysHandler::KeyEventType StickyKeysHandler::TranslateKeyEvent( | 302 StickyKeysHandler::KeyEventType StickyKeysHandler::TranslateKeyEvent( |
| 303 ui::EventType type, | 303 ui::EventType type, |
| 304 ui::KeyboardCode key_code) { | 304 ui::KeyboardCode key_code) { |
| 305 bool is_target_key = false; | 305 bool is_target_key = false; |
| 306 if (key_code == ui::VKEY_SHIFT || key_code == ui::VKEY_LSHIFT || | 306 if (key_code == ui::VKEY_SHIFT || key_code == ui::VKEY_LSHIFT || |
| 307 key_code == ui::VKEY_RSHIFT) { | 307 key_code == ui::VKEY_RSHIFT) { |
| 308 is_target_key = (modifier_flag_ == ui::EF_SHIFT_DOWN); | 308 is_target_key = (modifier_flag_ == ui::EF_SHIFT_DOWN); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 return false; | 395 return false; |
| 396 case OTHER_MODIFIER_DOWN: | 396 case OTHER_MODIFIER_DOWN: |
| 397 case OTHER_MODIFIER_UP: | 397 case OTHER_MODIFIER_UP: |
| 398 return false; | 398 return false; |
| 399 } | 399 } |
| 400 NOTREACHED(); | 400 NOTREACHED(); |
| 401 return false; | 401 return false; |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace ash | 404 } // namespace ash |
| OLD | NEW |