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

Side by Side Diff: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc

Issue 1550053002: Convert Pass()→std::move() in //chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" 5 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
6 6
7 #include <utility>
8
7 #include "apps/ui/views/app_window_frame_view.h" 9 #include "apps/ui/views/app_window_frame_view.h"
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "build/build_config.h" 11 #include "build/build_config.h"
10 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" 12 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h"
11 #include "ui/aura/test/aura_test_base.h" 13 #include "ui/aura/test/aura_test_base.h"
12 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
13 #include "ui/aura/window_event_dispatcher.h" 15 #include "ui/aura/window_event_dispatcher.h"
14 #include "ui/events/event_utils.h" 16 #include "ui/events/event_utils.h"
15 #include "ui/views/controls/webview/webview.h" 17 #include "ui/views/controls/webview/webview.h"
16 #include "ui/wm/core/default_activation_client.h" 18 #include "ui/wm/core/default_activation_client.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE, 71 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
70 ui::EF_NONE); 72 ui::EF_NONE);
71 ui::EventDispatchDetails details = 73 ui::EventDispatchDetails details =
72 event_processor()->OnEventFromSource(&move); 74 event_processor()->OnEventFromSource(&move);
73 ASSERT_FALSE(details.dispatcher_destroyed); 75 ASSERT_FALSE(details.dispatcher_destroyed);
74 EXPECT_EQ(window, move.target()); 76 EXPECT_EQ(window, move.target());
75 } 77 }
76 78
77 scoped_ptr<SkRegion> region(new SkRegion); 79 scoped_ptr<SkRegion> region(new SkRegion);
78 region->op(SkIRect::MakeXYWH(0, 0, 0, 0), SkRegion::kUnion_Op); 80 region->op(SkIRect::MakeXYWH(0, 0, 0, 0), SkRegion::kUnion_Op);
79 app_window()->UpdateShape(region.Pass()); 81 app_window()->UpdateShape(std::move(region));
80 { 82 {
81 // With an empty custom shape, all events within the window should fall 83 // With an empty custom shape, all events within the window should fall
82 // through to the root window. 84 // through to the root window.
83 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40), 85 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
84 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE, 86 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
85 ui::EF_NONE); 87 ui::EF_NONE);
86 ui::EventDispatchDetails details = 88 ui::EventDispatchDetails details =
87 event_processor()->OnEventFromSource(&move); 89 event_processor()->OnEventFromSource(&move);
88 ASSERT_FALSE(details.dispatcher_destroyed); 90 ASSERT_FALSE(details.dispatcher_destroyed);
89 EXPECT_EQ(root_window(), move.target()); 91 EXPECT_EQ(root_window(), move.target());
90 } 92 }
91 93
92 // Window shape (global coordinates) 94 // Window shape (global coordinates)
93 // 30 70 90 130 95 // 30 70 90 130
94 // 30 + +-----+ 96 // 30 + +-----+
95 // . | | <- mouse move (40,40) 97 // . | | <- mouse move (40,40)
96 // 70 +--------+ +---------+ 98 // 70 +--------+ +---------+
97 // | . | <- mouse move (80,80) 99 // | . | <- mouse move (80,80)
98 // 90 +--------+ +---------+ 100 // 90 +--------+ +---------+
99 // | | 101 // | |
100 // 130 +-----+ 102 // 130 +-----+
101 region.reset(new SkRegion); 103 region.reset(new SkRegion);
102 region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op); 104 region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op);
103 region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op); 105 region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op);
104 app_window()->UpdateShape(region.Pass()); 106 app_window()->UpdateShape(std::move(region));
105 { 107 {
106 // With the custom shape, the events that don't fall within the custom shape 108 // With the custom shape, the events that don't fall within the custom shape
107 // will go through to the root window. 109 // will go through to the root window.
108 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40), 110 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
109 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE, 111 gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
110 ui::EF_NONE); 112 ui::EF_NONE);
111 ui::EventDispatchDetails details = 113 ui::EventDispatchDetails details =
112 event_processor()->OnEventFromSource(&move); 114 event_processor()->OnEventFromSource(&move);
113 ASSERT_FALSE(details.dispatcher_destroyed); 115 ASSERT_FALSE(details.dispatcher_destroyed);
114 EXPECT_EQ(root_window(), move.target()); 116 EXPECT_EQ(root_window(), move.target());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ui::EF_NONE); 154 ui::EF_NONE);
153 ui::EventDispatchDetails details = 155 ui::EventDispatchDetails details =
154 event_processor()->OnEventFromSource(&move); 156 event_processor()->OnEventFromSource(&move);
155 ASSERT_FALSE(details.dispatcher_destroyed); 157 ASSERT_FALSE(details.dispatcher_destroyed);
156 EXPECT_EQ(window, move.target()); 158 EXPECT_EQ(window, move.target());
157 } 159 }
158 160
159 scoped_ptr<SkRegion> region(new SkRegion); 161 scoped_ptr<SkRegion> region(new SkRegion);
160 region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op); 162 region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op);
161 region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op); 163 region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op);
162 app_window()->UpdateShape(region.Pass()); 164 app_window()->UpdateShape(std::move(region));
163 { 165 {
164 // With the custom shape, the events that don't fall within the custom shape 166 // With the custom shape, the events that don't fall within the custom shape
165 // will go through to the root window. 167 // will go through to the root window.
166 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), 168 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
167 gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE, 169 gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
168 ui::EF_NONE); 170 ui::EF_NONE);
169 ui::EventDispatchDetails details = 171 ui::EventDispatchDetails details =
170 event_processor()->OnEventFromSource(&move); 172 event_processor()->OnEventFromSource(&move);
171 ASSERT_FALSE(details.dispatcher_destroyed); 173 ASSERT_FALSE(details.dispatcher_destroyed);
172 EXPECT_EQ(root_window(), move.target()); 174 EXPECT_EQ(root_window(), move.target());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37), 251 ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37),
250 gfx::Point(32, 37), ui::EventTimeForNow(), ui::EF_NONE, 252 gfx::Point(32, 37), ui::EventTimeForNow(), ui::EF_NONE,
251 ui::EF_NONE); 253 ui::EF_NONE);
252 ui::EventDispatchDetails details = 254 ui::EventDispatchDetails details =
253 event_processor()->OnEventFromSource(&move); 255 event_processor()->OnEventFromSource(&move);
254 ASSERT_FALSE(details.dispatcher_destroyed); 256 ASSERT_FALSE(details.dispatcher_destroyed);
255 EXPECT_EQ(window, move.target()); 257 EXPECT_EQ(window, move.target());
256 } 258 }
257 #endif // defined (OS_CHROMEOS) 259 #endif // defined (OS_CHROMEOS)
258 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698