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

Side by Side Diff: ui/aura/root_window.cc

Issue 10221028: Move DIP translation from ui/aura to ui/compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable tests that doesn't run on bots Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/window.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "ui/aura/aura_switches.h" 14 #include "ui/aura/aura_switches.h"
15 #include "ui/aura/client/activation_client.h" 15 #include "ui/aura/client/activation_client.h"
16 #include "ui/aura/client/event_client.h" 16 #include "ui/aura/client/event_client.h"
17 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
18 #include "ui/aura/event.h" 18 #include "ui/aura/event.h"
19 #include "ui/aura/event_filter.h" 19 #include "ui/aura/event_filter.h"
20 #include "ui/aura/focus_manager.h" 20 #include "ui/aura/focus_manager.h"
21 #include "ui/aura/monitor_manager.h"
21 #include "ui/aura/root_window_host.h" 22 #include "ui/aura/root_window_host.h"
22 #include "ui/aura/root_window_observer.h" 23 #include "ui/aura/root_window_observer.h"
23 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
24 #include "ui/aura/window_delegate.h" 25 #include "ui/aura/window_delegate.h"
25 #include "ui/base/gestures/gesture_recognizer.h" 26 #include "ui/base/gestures/gesture_recognizer.h"
26 #include "ui/base/gestures/gesture_types.h" 27 #include "ui/base/gestures/gesture_types.h"
27 #include "ui/base/hit_test.h" 28 #include "ui/base/hit_test.h"
28 #include "ui/compositor/compositor.h" 29 #include "ui/compositor/compositor.h"
30 #include "ui/compositor/dip_util.h"
29 #include "ui/compositor/layer.h" 31 #include "ui/compositor/layer.h"
30 #include "ui/compositor/layer_animator.h" 32 #include "ui/compositor/layer_animator.h"
33 #include "ui/gfx/monitor.h"
34 #include "ui/gfx/screen.h"
31 35
32 using std::vector; 36 using std::vector;
33 37
34 namespace aura { 38 namespace aura {
35 39
36 namespace { 40 namespace {
37 41
38 // Returns true if |target| has a non-client (frame) component at |location|, 42 // Returns true if |target| has a non-client (frame) component at |location|,
39 // in window coordinates. 43 // in window coordinates.
40 bool IsNonClientLocation(Window* target, const gfx::Point& location) { 44 bool IsNonClientLocation(Window* target, const gfx::Point& location) {
41 if (!target->delegate()) 45 if (!target->delegate())
42 return false; 46 return false;
43 int hit_test_code = target->delegate()->GetNonClientComponent(location); 47 int hit_test_code = target->delegate()->GetNonClientComponent(location);
44 return hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE; 48 return hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE;
45 } 49 }
46 50
47 typedef std::vector<EventFilter*> EventFilters; 51 typedef std::vector<EventFilter*> EventFilters;
48 52
49 void GetEventFiltersToNotify(Window* target, EventFilters* filters) { 53 void GetEventFiltersToNotify(Window* target, EventFilters* filters) {
50 while (target) { 54 while (target) {
51 if (target->event_filter()) 55 if (target->event_filter())
52 filters->push_back(target->event_filter()); 56 filters->push_back(target->event_filter());
53 target = target->parent(); 57 target = target->parent();
54 } 58 }
55 } 59 }
56 60
61 float GetDeviceScaleFactorFromMonitor(const aura::Window* window) {
62 MonitorManager* monitor_manager = Env::GetInstance()->monitor_manager();
63 return monitor_manager->GetMonitorNearestWindow(window).device_scale_factor();
64 }
65
57 const int kCompositorLockTimeoutMs = 67; 66 const int kCompositorLockTimeoutMs = 67;
58 67
59 } // namespace 68 } // namespace
60 69
61 CompositorLock::CompositorLock(RootWindow* root_window) 70 CompositorLock::CompositorLock(RootWindow* root_window)
62 : root_window_(root_window) { 71 : root_window_(root_window) {
63 MessageLoop::current()->PostDelayedTask( 72 MessageLoop::current()->PostDelayedTask(
64 FROM_HERE, 73 FROM_HERE,
65 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), 74 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()),
66 kCompositorLockTimeoutMs); 75 kCompositorLockTimeoutMs);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 defer_draw_scheduling_(false), 112 defer_draw_scheduling_(false),
104 mouse_move_hold_count_(0), 113 mouse_move_hold_count_(0),
105 should_hold_mouse_moves_(false), 114 should_hold_mouse_moves_(false),
106 compositor_lock_(NULL), 115 compositor_lock_(NULL),
107 draw_on_compositor_unlock_(false), 116 draw_on_compositor_unlock_(false),
108 draw_trace_count_(0) { 117 draw_trace_count_(0) {
109 SetName("RootWindow"); 118 SetName("RootWindow");
110 should_hold_mouse_moves_ = !CommandLine::ForCurrentProcess()->HasSwitch( 119 should_hold_mouse_moves_ = !CommandLine::ForCurrentProcess()->HasSwitch(
111 switches::kAuraDisableHoldMouseMoves); 120 switches::kAuraDisableHoldMouseMoves);
112 121
113 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget(), 122 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget()));
114 host_->GetBounds().size()));
115 DCHECK(compositor_.get()); 123 DCHECK(compositor_.get());
116 compositor_->AddObserver(this); 124 compositor_->AddObserver(this);
117 } 125 }
118 126
119 RootWindow::~RootWindow() { 127 RootWindow::~RootWindow() {
120 if (compositor_lock_) { 128 if (compositor_lock_) {
121 // No need to schedule a draw, we're going away. 129 // No need to schedule a draw, we're going away.
122 draw_on_compositor_unlock_ = false; 130 draw_on_compositor_unlock_ = false;
123 compositor_lock_->CancelLock(); 131 compositor_lock_->CancelLock();
124 DCHECK(!compositor_lock_); 132 DCHECK(!compositor_lock_);
125 } 133 }
126 compositor_->RemoveObserver(this); 134 compositor_->RemoveObserver(this);
127 // Make sure to destroy the compositor before terminating so that state is 135 // Make sure to destroy the compositor before terminating so that state is
128 // cleared and we don't hit asserts. 136 // cleared and we don't hit asserts.
129 compositor_.reset(); 137 compositor_.reset();
130 138
131 // Tear down in reverse. Frees any references held by the host. 139 // Tear down in reverse. Frees any references held by the host.
132 host_.reset(NULL); 140 host_.reset(NULL);
133 141
134 // An observer may have been added by an animation on the RootWindow. 142 // An observer may have been added by an animation on the RootWindow.
135 layer()->GetAnimator()->RemoveObserver(this); 143 layer()->GetAnimator()->RemoveObserver(this);
136 } 144 }
137 145
138 void RootWindow::Init() { 146 void RootWindow::Init() {
147 compositor()->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this),
148 host_->GetBounds().size());
139 Window::Init(ui::LAYER_NOT_DRAWN); 149 Window::Init(ui::LAYER_NOT_DRAWN);
140 last_mouse_location_ = ConvertPointToDIP(this, host_->QueryMouseLocation()); 150 last_mouse_location_ =
141 SetBounds(ConvertRectToDIP(this, gfx::Rect(host_->GetBounds().size()))); 151 ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation());
152 compositor()->SetRootLayer(layer());
153 SetBounds(
154 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size())));
142 Show(); 155 Show();
143 compositor()->SetRootLayer(layer());
144 host_->SetRootWindow(this); 156 host_->SetRootWindow(this);
145 } 157 }
146 158
147 void RootWindow::ShowRootWindow() { 159 void RootWindow::ShowRootWindow() {
148 host_->Show(); 160 host_->Show();
149 } 161 }
150 162
151 void RootWindow::SetHostSize(const gfx::Size& size) { 163 void RootWindow::SetHostSize(const gfx::Size& size_in_pixel) {
152 DispatchHeldMouseMove(); 164 DispatchHeldMouseMove();
153 gfx::Rect bounds = host_->GetBounds(); 165 gfx::Rect bounds = host_->GetBounds();
154 bounds.set_size(size); 166 bounds.set_size(size_in_pixel);
155 host_->SetBounds(bounds); 167 host_->SetBounds(bounds);
156 // Requery the location to constrain it within the new root window size. 168 // Requery the location to constrain it within the new root window size.
157 last_mouse_location_ = ConvertPointToDIP(this, host_->QueryMouseLocation()); 169 last_mouse_location_ =
170 ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation());
158 synthesize_mouse_move_ = false; 171 synthesize_mouse_move_ = false;
159 } 172 }
160 173
161 gfx::Size RootWindow::GetHostSize() const { 174 gfx::Size RootWindow::GetHostSize() const {
162 return host_->GetBounds().size(); 175 return host_->GetBounds().size();
163 } 176 }
164 177
165 void RootWindow::SetHostBounds(const gfx::Rect& bounds) { 178 void RootWindow::SetHostBounds(const gfx::Rect& bounds_in_pixel) {
166 DispatchHeldMouseMove(); 179 DispatchHeldMouseMove();
167 host_->SetBounds(bounds); 180 host_->SetBounds(bounds_in_pixel);
168 // Requery the location to constrain it within the new root window size. 181 // Requery the location to constrain it within the new root window size.
169 last_mouse_location_ = ConvertPointToDIP(this, host_->QueryMouseLocation()); 182 last_mouse_location_ =
183 ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation());
170 synthesize_mouse_move_ = false; 184 synthesize_mouse_move_ = false;
171 } 185 }
172 186
173 gfx::Point RootWindow::GetHostOrigin() const { 187 gfx::Point RootWindow::GetHostOrigin() const {
174 return host_->GetBounds().origin(); 188 return host_->GetBounds().origin();
175 } 189 }
176 190
177 void RootWindow::SetCursor(gfx::NativeCursor cursor) { 191 void RootWindow::SetCursor(gfx::NativeCursor cursor) {
178 last_cursor_ = cursor; 192 last_cursor_ = cursor;
179 // A lot of code seems to depend on NULL cursors actually showing an arrow, 193 // A lot of code seems to depend on NULL cursors actually showing an arrow,
180 // so just pass everything along to the host. 194 // so just pass everything along to the host.
181 host_->SetCursor(cursor); 195 host_->SetCursor(cursor);
182 } 196 }
183 197
184 void RootWindow::ShowCursor(bool show) { 198 void RootWindow::ShowCursor(bool show) {
185 cursor_shown_ = show; 199 cursor_shown_ = show;
186 host_->ShowCursor(show); 200 host_->ShowCursor(show);
187 } 201 }
188 202
189 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { 203 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) {
190 host_->MoveCursorTo(ConvertPointToPixel(this, location_in_dip)); 204 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location_in_dip));
191 } 205 }
192 206
193 bool RootWindow::ConfineCursorToWindow() { 207 bool RootWindow::ConfineCursorToWindow() {
194 // We would like to be able to confine the cursor to that window. However, 208 // We would like to be able to confine the cursor to that window. However,
195 // currently, we do not have such functionality in X. So we just confine 209 // currently, we do not have such functionality in X. So we just confine
196 // to the root window. This is ok because this option is currently only 210 // to the root window. This is ok because this option is currently only
197 // being used in fullscreen mode, so root_window bounds = window bounds. 211 // being used in fullscreen mode, so root_window bounds = window bounds.
198 return host_->ConfineCursorToRootWindow(); 212 return host_->ConfineCursorToRootWindow();
199 } 213 }
200 214
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 client::EventClient* client = client::GetEventClient(GetRootWindow()); 256 client::EventClient* client = client::GetEventClient(GetRootWindow());
243 if (client && !client->CanProcessEventsWithinSubtree(focused_window_)) { 257 if (client && !client->CanProcessEventsWithinSubtree(focused_window_)) {
244 SetFocusedWindow(NULL, NULL); 258 SetFocusedWindow(NULL, NULL);
245 return false; 259 return false;
246 } 260 }
247 return ProcessKeyEvent(focused_window_, &translated_event); 261 return ProcessKeyEvent(focused_window_, &translated_event);
248 } 262 }
249 263
250 bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { 264 bool RootWindow::DispatchScrollEvent(ScrollEvent* event) {
251 DispatchHeldMouseMove(); 265 DispatchHeldMouseMove();
252 #if defined(ENABLE_DIP) 266 if (ui::IsDIPEnabled()) {
253 float scale = GetMonitorScaleFactor(this); 267 float scale = ui::GetDeviceScaleFactor(layer());
254 ui::Transform transform; 268 ui::Transform transform = layer()->transform();
255 transform.SetScale(scale, scale); 269 transform.ConcatScale(scale, scale);
256 transform.ConcatTransform(layer()->transform()); 270 event->UpdateForRootTransform(transform);
257 event->UpdateForRootTransform(transform); 271 } else {
258 #else 272 event->UpdateForRootTransform(layer()->transform());
259 event->UpdateForRootTransform(layer()->transform()); 273 }
260 #endif
261 274
262 last_mouse_location_ = event->location(); 275 last_mouse_location_ = event->location();
263 synthesize_mouse_move_ = false; 276 synthesize_mouse_move_ = false;
264 277
265 Window* target = 278 Window* target =
266 mouse_pressed_handler_ ? mouse_pressed_handler_ : capture_window_; 279 mouse_pressed_handler_ ? mouse_pressed_handler_ : capture_window_;
267 if (!target) 280 if (!target)
268 target = GetEventHandlerForPoint(event->location()); 281 target = GetEventHandlerForPoint(event->location());
269 282
270 if (target && target->delegate()) { 283 if (target && target->delegate()) {
271 int flags = event->flags(); 284 int flags = event->flags();
272 gfx::Point location_in_window = event->location(); 285 gfx::Point location_in_window = event->location();
273 Window::ConvertPointToWindow(this, target, &location_in_window); 286 Window::ConvertPointToWindow(this, target, &location_in_window);
274 if (IsNonClientLocation(target, location_in_window)) 287 if (IsNonClientLocation(target, location_in_window))
275 flags |= ui::EF_IS_NON_CLIENT; 288 flags |= ui::EF_IS_NON_CLIENT;
276 ScrollEvent translated_event(*event, this, target, event->type(), flags); 289 ScrollEvent translated_event(*event, this, target, event->type(), flags);
277 return ProcessMouseEvent(target, &translated_event); 290 return ProcessMouseEvent(target, &translated_event);
278 } 291 }
279 return false; 292 return false;
280 } 293 }
281 294
282 bool RootWindow::DispatchTouchEvent(TouchEvent* event) { 295 bool RootWindow::DispatchTouchEvent(TouchEvent* event) {
283 DispatchHeldMouseMove(); 296 DispatchHeldMouseMove();
284 #if defined(ENABLE_DIP) 297 if (ui::IsDIPEnabled()) {
285 float scale = GetMonitorScaleFactor(this); 298 float scale = ui::GetDeviceScaleFactor(layer());
286 ui::Transform transform; 299 ui::Transform transform = layer()->transform();
287 transform.SetScale(scale, scale); 300 transform.ConcatScale(scale, scale);
288 transform.ConcatTransform(layer()->transform()); 301 event->UpdateForRootTransform(transform);
289 event->UpdateForRootTransform(transform); 302 } else {
290 #else 303 event->UpdateForRootTransform(layer()->transform());
291 event->UpdateForRootTransform(layer()->transform()); 304 }
292 #endif
293 bool handled = false; 305 bool handled = false;
294 306
295 GestureConsumer* consumer = gesture_recognizer_->GetTouchLockedTarget(event); 307 GestureConsumer* consumer = gesture_recognizer_->GetTouchLockedTarget(event);
296 ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN; 308 ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN;
297 309
298 if (!consumer || !consumer->ignores_events()) { 310 if (!consumer || !consumer->ignores_events()) {
299 Window* target = static_cast<Window*>(consumer); 311 Window* target = static_cast<Window*>(consumer);
300 312
301 if (!target && HasCapture(capture_window_, ui::CW_LOCK_TOUCH)) 313 if (!target && HasCapture(capture_window_, ui::CW_LOCK_TOUCH))
302 target = capture_window_; 314 target = capture_window_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 366
355 if (target) { 367 if (target) {
356 GestureEvent translated_event(*event, this, target); 368 GestureEvent translated_event(*event, this, target);
357 ui::GestureStatus status = ProcessGestureEvent(target, &translated_event); 369 ui::GestureStatus status = ProcessGestureEvent(target, &translated_event);
358 return status != ui::GESTURE_STATUS_UNKNOWN; 370 return status != ui::GESTURE_STATUS_UNKNOWN;
359 } 371 }
360 372
361 return false; 373 return false;
362 } 374 }
363 375
364 void RootWindow::OnHostResized(const gfx::Size& size) { 376 void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) {
365 DispatchHeldMouseMove(); 377 DispatchHeldMouseMove();
366 // The compositor should have the same size as the native root window host. 378 // The compositor should have the same size as the native root window host.
367 compositor_->WidgetSizeChanged(size); 379 // Get the latest scale from monitor because it might have been changed.
368 gfx::Size old(ConvertSizeToDIP(this, bounds().size())); 380 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this),
381 size_in_pixel);
382 gfx::Size old(bounds().size());
369 // The layer, and all the observers should be notified of the 383 // The layer, and all the observers should be notified of the
370 // transformed size of the root window. 384 // transformed size of the root window.
371 gfx::Rect bounds(ConvertSizeToDIP(this, size)); 385 gfx::Rect bounds(ui::ConvertSizeToDIP(layer(), size_in_pixel));
372 layer()->transform().TransformRect(&bounds); 386 layer()->transform().TransformRect(&bounds);
373 SetBounds(gfx::Rect(bounds.size())); 387 SetBounds(bounds);
374 FOR_EACH_OBSERVER(RootWindowObserver, observers_, 388 FOR_EACH_OBSERVER(RootWindowObserver, observers_,
375 OnRootWindowResized(this, old)); 389 OnRootWindowResized(this, old));
376 } 390 }
377 391
378 void RootWindow::OnWindowDestroying(Window* window) { 392 void RootWindow::OnWindowDestroying(Window* window) {
379 OnWindowHidden(window, true); 393 OnWindowHidden(window, true);
380 394
381 if (window->IsVisible() && 395 if (window->IsVisible() &&
382 window->ContainsPointInRoot(last_mouse_location_)) { 396 window->ContainsPointInRoot(last_mouse_location_)) {
383 PostMouseMoveEventAfterWindowChange(); 397 PostMouseMoveEventAfterWindowChange();
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 908
895 bool RootWindow::IsFocusedWindow(const Window* window) const { 909 bool RootWindow::IsFocusedWindow(const Window* window) const {
896 return focused_window_ == window; 910 return focused_window_ == window;
897 } 911 }
898 912
899 bool RootWindow::DispatchMouseEventImpl(MouseEvent* event) { 913 bool RootWindow::DispatchMouseEventImpl(MouseEvent* event) {
900 static const int kMouseButtonFlagMask = 914 static const int kMouseButtonFlagMask =
901 ui::EF_LEFT_MOUSE_BUTTON | 915 ui::EF_LEFT_MOUSE_BUTTON |
902 ui::EF_MIDDLE_MOUSE_BUTTON | 916 ui::EF_MIDDLE_MOUSE_BUTTON |
903 ui::EF_RIGHT_MOUSE_BUTTON; 917 ui::EF_RIGHT_MOUSE_BUTTON;
904 #if defined(ENABLE_DIP) 918 if (ui::IsDIPEnabled()) {
905 float scale = GetMonitorScaleFactor(this); 919 float scale = ui::GetDeviceScaleFactor(layer());
906 ui::Transform transform; 920 ui::Transform transform = layer()->transform();
907 transform.SetScale(scale, scale); 921 transform.ConcatScale(scale, scale);
908 transform.ConcatTransform(layer()->transform()); 922 event->UpdateForRootTransform(transform);
909 event->UpdateForRootTransform(transform); 923 } else {
910 #else 924 event->UpdateForRootTransform(layer()->transform());
911 event->UpdateForRootTransform(layer()->transform()); 925 }
912 #endif
913 926
914 last_mouse_location_ = event->location(); 927 last_mouse_location_ = event->location();
915 synthesize_mouse_move_ = false; 928 synthesize_mouse_move_ = false;
916 929
917 Window* target = mouse_pressed_handler_; 930 Window* target = mouse_pressed_handler_;
918 if (!target && HasCapture(capture_window_, ui::CW_LOCK_MOUSE)) 931 if (!target && HasCapture(capture_window_, ui::CW_LOCK_MOUSE))
919 target = capture_window_; 932 target = capture_window_;
920 if (!target) 933 if (!target)
921 target = GetEventHandlerForPoint(event->location()); 934 target = GetEventHandlerForPoint(event->location());
922 switch (event->type()) { 935 switch (event->type()) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 event_factory_.GetWeakPtr())); 982 event_factory_.GetWeakPtr()));
970 } 983 }
971 984
972 void RootWindow::SynthesizeMouseMoveEvent() { 985 void RootWindow::SynthesizeMouseMoveEvent() {
973 if (!synthesize_mouse_move_) 986 if (!synthesize_mouse_move_)
974 return; 987 return;
975 synthesize_mouse_move_ = false; 988 synthesize_mouse_move_ = false;
976 #if !defined(OS_WIN) 989 #if !defined(OS_WIN)
977 // Temporarily disabled for windows. See crbug.com/112222. 990 // Temporarily disabled for windows. See crbug.com/112222.
978 gfx::Point orig_mouse_location = last_mouse_location_; 991 gfx::Point orig_mouse_location = last_mouse_location_;
979 orig_mouse_location = ConvertPointToPixel(this, orig_mouse_location);
980 layer()->transform().TransformPoint(orig_mouse_location); 992 layer()->transform().TransformPoint(orig_mouse_location);
981 orig_mouse_location = ConvertPointToDIP(this,orig_mouse_location);
982 993
983 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's 994 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's
984 // currently broken. See/ crbug.com/107931. 995 // currently broken. See/ crbug.com/107931.
985 MouseEvent event(ui::ET_MOUSE_MOVED, 996 MouseEvent event(ui::ET_MOUSE_MOVED,
986 orig_mouse_location, 997 orig_mouse_location,
987 orig_mouse_location, 998 orig_mouse_location,
988 ui::EF_IS_SYNTHESIZED); 999 ui::EF_IS_SYNTHESIZED);
989 DispatchMouseEvent(&event); 1000 DispatchMouseEvent(&event);
990 #endif 1001 #endif
991 } 1002 }
992 1003
993 void RootWindow::UnlockCompositor() { 1004 void RootWindow::UnlockCompositor() {
994 DCHECK(compositor_lock_); 1005 DCHECK(compositor_lock_);
995 compositor_lock_ = NULL; 1006 compositor_lock_ = NULL;
996 if (draw_on_compositor_unlock_) { 1007 if (draw_on_compositor_unlock_) {
997 draw_on_compositor_unlock_ = false; 1008 draw_on_compositor_unlock_ = false;
998 ScheduleDraw(); 1009 ScheduleDraw();
999 } 1010 }
1000 } 1011 }
1001 1012
1002 } // namespace aura 1013 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698