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

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

Issue 431973006: Fix flakiness of DesktopDragDropClientAuraX11Tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
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/views/widget/desktop_aura/x11_whole_screen_move_loop.h" 5 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. 8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
9 #undef RootWindow 9 #undef RootWindow
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 private: 50 private:
51 aura::WindowTreeHost* host_; 51 aura::WindowTreeHost* host_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(ScopedCapturer); 53 DISALLOW_COPY_AND_ASSIGN(ScopedCapturer);
54 }; 54 };
55 55
56 } // namespace 56 } // namespace
57 57
58 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop( 58 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate)
59 X11WholeScreenMoveLoopDelegate* delegate)
60 : delegate_(delegate), 59 : delegate_(delegate),
61 in_move_loop_(false), 60 in_move_loop_(false),
62 should_reset_mouse_flags_(false), 61 should_reset_mouse_flags_(false),
63 grab_input_window_(None), 62 grab_input_window_(None),
64 canceled_(false), 63 canceled_(false),
65 has_grab_(false), 64 has_grab_(false),
66 weak_factory_(this) { 65 weak_factory_(this) {
67 last_xmotion_.type = LASTEvent; 66 last_xmotion_.type = LASTEvent;
68 } 67 }
69 68
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 drag_widget_.reset(); 269 drag_widget_.reset();
271 delegate_->OnMoveLoopEnded(); 270 delegate_->OnMoveLoopEnded();
272 XDestroyWindow(display, grab_input_window_); 271 XDestroyWindow(display, grab_input_window_);
273 grab_input_window_ = None; 272 grab_input_window_ = None;
274 273
275 in_move_loop_ = false; 274 in_move_loop_ = false;
276 quit_closure_.Run(); 275 quit_closure_.Run();
277 } 276 }
278 277
279 void X11WholeScreenMoveLoop::SetDragImage(const gfx::ImageSkia& image, 278 void X11WholeScreenMoveLoop::SetDragImage(const gfx::ImageSkia& image,
280 gfx::Vector2dF offset) { 279 const gfx::Vector2dF& offset) {
281 drag_image_ = image; 280 drag_image_ = image;
282 drag_offset_ = offset; 281 drag_offset_ = offset;
283 } 282 }
284 283
285 bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) { 284 bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) {
286 XDisplay* display = gfx::GetXDisplay(); 285 XDisplay* display = gfx::GetXDisplay();
287 XGrabServer(display); 286 XGrabServer(display);
288 287
289 XUngrabPointer(display, CurrentTime); 288 XUngrabPointer(display, CurrentTime);
290 int ret = XGrabPointer( 289 int ret = XGrabPointer(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 for (int x = 0; x < in_bitmap->width(); ++x) { 380 for (int x = 0; x < in_bitmap->width(); ++x) {
382 if (SkColorGetA(in_row[x]) > kMinAlpha) 381 if (SkColorGetA(in_row[x]) > kMinAlpha)
383 return true; 382 return true;
384 } 383 }
385 } 384 }
386 385
387 return false; 386 return false;
388 } 387 }
389 388
390 } // namespace views 389 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698