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

Side by Side Diff: ash/sticky_keys/sticky_keys_controller.cc

Issue 2743193002: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in ash/ (Closed)
Patch Set: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in ash/ Created 3 years, 9 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
« no previous file with comments | « no previous file | ash/test/shelf_button_pressed_metric_tracker_test_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/test/shelf_button_pressed_metric_tracker_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698