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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 <vector> 5 #include <vector>
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 // Get rid of X11 macros which conflict with gtest. 10 // Get rid of X11 macros which conflict with gtest.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Creates a widget of size 100x100. 142 // Creates a widget of size 100x100.
143 scoped_ptr<Widget> CreateWidget(WidgetDelegate* delegate) { 143 scoped_ptr<Widget> CreateWidget(WidgetDelegate* delegate) {
144 scoped_ptr<Widget> widget(new Widget); 144 scoped_ptr<Widget> widget(new Widget);
145 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); 145 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
146 params.delegate = delegate; 146 params.delegate = delegate;
147 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 147 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
148 params.remove_standard_frame = true; 148 params.remove_standard_frame = true;
149 params.native_widget = new DesktopNativeWidgetAura(widget.get()); 149 params.native_widget = new DesktopNativeWidgetAura(widget.get());
150 params.bounds = gfx::Rect(100, 100, 100, 100); 150 params.bounds = gfx::Rect(100, 100, 100, 100);
151 widget->Init(params); 151 widget->Init(params);
152 return widget.Pass(); 152 return widget;
153 } 153 }
154 154
155 // Returns the list of rectangles which describe |xid|'s bounding region via the 155 // Returns the list of rectangles which describe |xid|'s bounding region via the
156 // X shape extension. 156 // X shape extension.
157 std::vector<gfx::Rect> GetShapeRects(XID xid) { 157 std::vector<gfx::Rect> GetShapeRects(XID xid) {
158 int dummy; 158 int dummy;
159 int shape_rects_size; 159 int shape_rects_size;
160 gfx::XScopedPtr<XRectangle[]> shape_rects(XShapeGetRectangles( 160 gfx::XScopedPtr<XRectangle[]> shape_rects(XShapeGetRectangles(
161 gfx::GetXDisplay(), xid, ShapeBounding, &shape_rects_size, &dummy)); 161 gfx::GetXDisplay(), xid, ShapeBounding, &shape_rects_size, &dummy));
162 162
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 EXPECT_EQ(ui::ET_MOUSEWHEEL, second_recorder.mouse_events()[0].type()); 642 EXPECT_EQ(ui::ET_MOUSEWHEEL, second_recorder.mouse_events()[0].type());
643 EXPECT_EQ(gfx::Point(-25, -25).ToString(), 643 EXPECT_EQ(gfx::Point(-25, -25).ToString(),
644 second_recorder.mouse_events()[0].location().ToString()); 644 second_recorder.mouse_events()[0].location().ToString());
645 645
646 PretendCapture(nullptr); 646 PretendCapture(nullptr);
647 first.GetNativeWindow()->RemovePreTargetHandler(&first_recorder); 647 first.GetNativeWindow()->RemovePreTargetHandler(&first_recorder);
648 second.GetNativeWindow()->RemovePreTargetHandler(&second_recorder); 648 second.GetNativeWindow()->RemovePreTargetHandler(&second_recorder);
649 } 649 }
650 650
651 } // namespace views 651 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698