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

Side by Side Diff: ui/events/test/event_generator.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/events/test/event_generator.h" 5 #include "ui/events/test/event_generator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 void EventGenerator::ReleaseKey(ui::KeyboardCode key_code, int flags) { 536 void EventGenerator::ReleaseKey(ui::KeyboardCode key_code, int flags) {
537 DispatchKeyEvent(false, key_code, flags); 537 DispatchKeyEvent(false, key_code, flags);
538 } 538 }
539 539
540 void EventGenerator::Dispatch(ui::Event* event) { 540 void EventGenerator::Dispatch(ui::Event* event) {
541 DoDispatchEvent(event, async_); 541 DoDispatchEvent(event, async_);
542 } 542 }
543 543
544 void EventGenerator::Init(gfx::NativeWindow root_window, 544 void EventGenerator::Init(gfx::NativeWindow root_window,
545 gfx::NativeWindow window_context) { 545 gfx::NativeWindow window_context) {
546 ui::SetEventTickClockForTesting(WrapUnique(new TestTickClock())); 546 ui::SetEventTickClockForTesting(base::MakeUnique<TestTickClock>());
547 delegate()->SetContext(this, root_window, window_context); 547 delegate()->SetContext(this, root_window, window_context);
548 if (window_context) 548 if (window_context)
549 current_location_ = delegate()->CenterOfWindow(window_context); 549 current_location_ = delegate()->CenterOfWindow(window_context);
550 current_target_ = delegate()->GetTargetAt(current_location_); 550 current_target_ = delegate()->GetTargetAt(current_location_);
551 } 551 }
552 552
553 void EventGenerator::DispatchKeyEvent(bool is_press, 553 void EventGenerator::DispatchKeyEvent(bool is_press,
554 ui::KeyboardCode key_code, 554 ui::KeyboardCode key_code,
555 int flags) { 555 int flags) {
556 #if defined(OS_WIN) 556 #if defined(OS_WIN)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 return default_delegate; 667 return default_delegate;
668 } 668 }
669 669
670 EventGeneratorDelegate* EventGenerator::delegate() { 670 EventGeneratorDelegate* EventGenerator::delegate() {
671 return const_cast<EventGeneratorDelegate*>( 671 return const_cast<EventGeneratorDelegate*>(
672 const_cast<const EventGenerator*>(this)->delegate()); 672 const_cast<const EventGenerator*>(this)->delegate());
673 } 673 }
674 674
675 } // namespace test 675 } // namespace test
676 } // namespace ui 676 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source_libevent.cc ('k') | ui/events/test/test_event_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698