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

Side by Side Diff: ui/views/view_targeter_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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/view.cc ('k') | ui/views/view_unittest.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 #include "ui/views/view_targeter.h" 5 #include "ui/views/view_targeter.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h"
8 #include "ui/events/event_targeter.h" 9 #include "ui/events/event_targeter.h"
9 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
10 #include "ui/gfx/path.h" 11 #include "ui/gfx/path.h"
11 #include "ui/views/masked_targeter_delegate.h" 12 #include "ui/views/masked_targeter_delegate.h"
12 #include "ui/views/test/views_test_base.h" 13 #include "ui/views/test/views_test_base.h"
13 #include "ui/views/view_targeter.h" 14 #include "ui/views/view_targeter.h"
14 #include "ui/views/view_targeter_delegate.h" 15 #include "ui/views/view_targeter_delegate.h"
15 #include "ui/views/views_switches.h" 16 #include "ui/views/views_switches.h"
16 #include "ui/views/widget/root_view.h" 17 #include "ui/views/widget/root_view.h"
17 18
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 v1->SetBoundsRect(v1_bounds); 611 v1->SetBoundsRect(v1_bounds);
611 root_view->AddChildView(v1); 612 root_view->AddChildView(v1);
612 613
613 // |v2| has a triangular hit test mask. Install a ViewTargeter on |v2| which 614 // |v2| has a triangular hit test mask. Install a ViewTargeter on |v2| which
614 // will be called into by View::HitTestRect(). 615 // will be called into by View::HitTestRect().
615 gfx::Rect v2_bounds = gfx::Rect(105, 0, 100, 100); 616 gfx::Rect v2_bounds = gfx::Rect(105, 0, 100, 100);
616 TestMaskedView* v2 = new TestMaskedView(); 617 TestMaskedView* v2 = new TestMaskedView();
617 v2->SetBoundsRect(v2_bounds); 618 v2->SetBoundsRect(v2_bounds);
618 root_view->AddChildView(v2); 619 root_view->AddChildView(v2);
619 ViewTargeter* view_targeter = new ViewTargeter(v2); 620 ViewTargeter* view_targeter = new ViewTargeter(v2);
620 v2->SetEventTargeter(make_scoped_ptr(view_targeter)); 621 v2->SetEventTargeter(base::WrapUnique(view_targeter));
621 622
622 gfx::Point v1_centerpoint = v1_bounds.CenterPoint(); 623 gfx::Point v1_centerpoint = v1_bounds.CenterPoint();
623 gfx::Point v2_centerpoint = v2_bounds.CenterPoint(); 624 gfx::Point v2_centerpoint = v2_bounds.CenterPoint();
624 gfx::Point v1_origin = v1_bounds.origin(); 625 gfx::Point v1_origin = v1_bounds.origin();
625 gfx::Point v2_origin = v2_bounds.origin(); 626 gfx::Point v2_origin = v2_bounds.origin();
626 gfx::Rect r1(10, 10, 110, 15); 627 gfx::Rect r1(10, 10, 110, 15);
627 gfx::Rect r2(106, 1, 98, 98); 628 gfx::Rect r2(106, 1, 98, 98);
628 gfx::Rect r3(0, 0, 300, 300); 629 gfx::Rect r3(0, 0, 300, 300);
629 gfx::Rect r4(115, 342, 200, 10); 630 gfx::Rect r4(115, 342, 200, 10);
630 631
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin)); 665 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin));
665 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin)); 666 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin));
666 667
667 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin)); 668 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin));
668 669
669 widget->CloseNow(); 670 widget->CloseNow();
670 } 671 }
671 672
672 } // namespace test 673 } // namespace test
673 } // namespace views 674 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698