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

Side by Side Diff: ash/host/ash_window_tree_host_x11.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 | « ash/host/ash_window_tree_host_x11.h ('k') | ash/host/ash_window_tree_host_x11_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 "ash/host/ash_window_tree_host_x11.h" 5 #include "ash/host/ash_window_tree_host_x11.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/extensions/Xfixes.h> 10 #include <X11/extensions/Xfixes.h>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[0]); 104 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[0]);
105 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[1]); 105 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[1]);
106 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[2]); 106 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[2]);
107 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[3]); 107 XFixesDestroyPointerBarrier(xdisplay(), pointer_barriers_[3]);
108 pointer_barriers_.reset(); 108 pointer_barriers_.reset();
109 } 109 }
110 #endif 110 #endif
111 } 111 }
112 112
113 void AshWindowTreeHostX11::SetRootWindowTransformer( 113 void AshWindowTreeHostX11::SetRootWindowTransformer(
114 scoped_ptr<RootWindowTransformer> transformer) { 114 std::unique_ptr<RootWindowTransformer> transformer) {
115 transformer_helper_.SetRootWindowTransformer(std::move(transformer)); 115 transformer_helper_.SetRootWindowTransformer(std::move(transformer));
116 if (pointer_barriers_) { 116 if (pointer_barriers_) {
117 UnConfineCursor(); 117 UnConfineCursor();
118 ConfineCursorToRootWindow(); 118 ConfineCursorToRootWindow();
119 } 119 }
120 } 120 }
121 121
122 gfx::Insets AshWindowTreeHostX11::GetHostInsets() const { 122 gfx::Insets AshWindowTreeHostX11::GetHostInsets() const {
123 return transformer_helper_.GetHostInsets(); 123 return transformer_helper_.GetHostInsets();
124 } 124 }
125 125
126 aura::WindowTreeHost* AshWindowTreeHostX11::AsWindowTreeHost() { return this; } 126 aura::WindowTreeHost* AshWindowTreeHostX11::AsWindowTreeHost() { return this; }
127 127
128 void AshWindowTreeHostX11::PrepareForShutdown() { 128 void AshWindowTreeHostX11::PrepareForShutdown() {
129 // Block the root window from dispatching events because it is weird for a 129 // Block the root window from dispatching events because it is weird for a
130 // ScreenPositionClient not to be attached to the root window and for 130 // ScreenPositionClient not to be attached to the root window and for
131 // ui::EventHandlers to be unable to convert the event's location to screen 131 // ui::EventHandlers to be unable to convert the event's location to screen
132 // coordinates. 132 // coordinates.
133 window()->SetEventTargeter( 133 window()->SetEventTargeter(
134 scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter)); 134 std::unique_ptr<ui::EventTargeter>(new ui::NullEventTargeter));
135 135
136 if (ui::PlatformEventSource::GetInstance()) { 136 if (ui::PlatformEventSource::GetInstance()) {
137 // Block X events which are not turned into ui::Events from getting 137 // Block X events which are not turned into ui::Events from getting
138 // processed. (e.g. ConfigureNotify) 138 // processed. (e.g. ConfigureNotify)
139 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); 139 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
140 } 140 }
141 } 141 }
142 142
143 void AshWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { 143 void AshWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
144 WindowTreeHostX11::SetBounds(bounds); 144 WindowTreeHostX11::SetBounds(bounds);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 8, 284 8,
285 PropModeReplace, 285 PropModeReplace,
286 &value, 286 &value,
287 1); 287 1);
288 } 288 }
289 } 289 }
290 } 290 }
291 #endif // defined(OS_CHROMEOS) 291 #endif // defined(OS_CHROMEOS)
292 292
293 } // namespace ash 293 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_x11.h ('k') | ash/host/ash_window_tree_host_x11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698