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

Side by Side Diff: ui/views/test/event_generator_delegate_mac.mm

Issue 809903005: ui/views: Cleanup usage of scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no need of Pass() Created 5 years, 11 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 | « ui/views/painter.cc ('k') | ui/views/view.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 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "base/mac/scoped_objc_class_swizzler.h" 7 #import "base/mac/scoped_objc_class_swizzler.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "ui/events/event_processor.h" 9 #include "ui/events/event_processor.h"
10 #include "ui/events/event_target.h" 10 #include "ui/events/event_target.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 306
307 EventGeneratorDelegateMac::~EventGeneratorDelegateMac() { 307 EventGeneratorDelegateMac::~EventGeneratorDelegateMac() {
308 DCHECK_EQ(this, ui::test::EventGenerator::default_delegate); 308 DCHECK_EQ(this, ui::test::EventGenerator::default_delegate);
309 ui::test::EventGenerator::default_delegate = NULL; 309 ui::test::EventGenerator::default_delegate = NULL;
310 } 310 }
311 311
312 scoped_ptr<ui::EventTargetIterator> 312 scoped_ptr<ui::EventTargetIterator>
313 EventGeneratorDelegateMac::GetChildIterator() const { 313 EventGeneratorDelegateMac::GetChildIterator() const {
314 // Return NULL to dispatch all events to the result of GetRootTarget(). 314 // Return NULL to dispatch all events to the result of GetRootTarget().
315 return scoped_ptr<ui::EventTargetIterator>(); 315 return nullptr;
316 } 316 }
317 317
318 void EventGeneratorDelegateMac::OnMouseEvent(ui::MouseEvent* event) { 318 void EventGeneratorDelegateMac::OnMouseEvent(ui::MouseEvent* event) {
319 // For mouse drag events, ensure the swizzled methods return the right flags. 319 // For mouse drag events, ensure the swizzled methods return the right flags.
320 base::AutoReset<ui::test::EventGenerator*> reset(&g_active_generator, owner_); 320 base::AutoReset<ui::test::EventGenerator*> reset(&g_active_generator, owner_);
321 NSEvent* ns_event = CreateMouseEventInWindow(window_, 321 NSEvent* ns_event = CreateMouseEventInWindow(window_,
322 event->type(), 322 event->type(),
323 event->location(), 323 event->location(),
324 event->changed_button_flags()); 324 event->changed_button_flags());
325 if (owner_->targeting_application()) 325 if (owner_->targeting_application())
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 namespace views { 359 namespace views {
360 namespace test { 360 namespace test {
361 361
362 void InitializeMacEventGeneratorDelegate() { 362 void InitializeMacEventGeneratorDelegate() {
363 EventGeneratorDelegateMac::GetInstance(); 363 EventGeneratorDelegateMac::GetInstance();
364 } 364 }
365 365
366 } // namespace test 366 } // namespace test
367 } // namespace views 367 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/painter.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698