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

Side by Side Diff: ash/drag_drop/drag_drop_tracker.cc

Issue 11009010: Set DragDropTracker's capture window's size to zero, otherwise, it gets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | 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 "ash/drag_drop/drag_drop_tracker.h" 5 #include "ash/drag_drop/drag_drop_tracker.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/coordinate_conversion.h" 9 #include "ash/wm/coordinate_conversion.h"
10 #include "ui/aura/root_window.h" 10 #include "ui/aura/root_window.h"
11 #include "ui/base/events/event.h" 11 #include "ui/base/events/event.h"
12 #include "ui/gfx/screen.h" 12 #include "ui/gfx/screen.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Creates a window for capturing drag events. 16 // Creates a window for capturing drag events.
17 aura::Window* CreateCaptureWindow(aura::RootWindow* root_window) { 17 aura::Window* CreateCaptureWindow(aura::RootWindow* root_window) {
mazda 2012/10/01 17:30:03 Could you delete |root_window| argument?
varunjain 2012/10/01 18:41:09 Done.
18 aura::Window* window = new aura::Window(NULL); 18 aura::Window* window = new aura::Window(NULL);
19 window->SetType(aura::client::WINDOW_TYPE_NORMAL); 19 window->SetType(aura::client::WINDOW_TYPE_NORMAL);
20 window->Init(ui::LAYER_NOT_DRAWN); 20 window->Init(ui::LAYER_NOT_DRAWN);
21 window->SetParent(NULL); 21 window->SetParent(NULL);
22 window->SetBoundsInScreen(root_window->GetBoundsInScreen(),
mazda 2012/09/29 06:47:56 Does dragging from the 2nd display to primary one
varunjain 2012/10/01 02:59:06 seems to be working fine.
23 gfx::Screen::GetDisplayNearestWindow(root_window));
24 window->Show(); 22 window->Show();
25 return window; 23 return window;
26 } 24 }
27 25
28 } // namespace 26 } // namespace
29 27
30 namespace ash { 28 namespace ash {
31 namespace internal { 29 namespace internal {
32 30
33 DragDropTracker::DragDropTracker(aura::RootWindow* root_window) 31 DragDropTracker::DragDropTracker(aura::RootWindow* root_window)
mazda 2012/10/01 17:30:03 This one as well.
varunjain 2012/10/01 18:41:09 Done.
34 : capture_window_(CreateCaptureWindow(root_window)) { 32 : capture_window_(CreateCaptureWindow(root_window)) {
35 capture_window_->SetCapture(); 33 capture_window_->SetCapture();
36 } 34 }
37 35
38 DragDropTracker::~DragDropTracker() { 36 DragDropTracker::~DragDropTracker() {
39 capture_window_->ReleaseCapture(); 37 capture_window_->ReleaseCapture();
40 } 38 }
41 39
42 aura::Window* DragDropTracker::GetTarget(const ui::LocatedEvent& event) { 40 aura::Window* DragDropTracker::GetTarget(const ui::LocatedEvent& event) {
43 DCHECK(capture_window_.get()); 41 DCHECK(capture_window_.get());
(...skipping 22 matching lines...) Expand all
66 ash::wm::GetRootWindowAt(location_in_screen), 64 ash::wm::GetRootWindowAt(location_in_screen),
67 &target_root_location); 65 &target_root_location);
68 return new ui::MouseEvent(event.type(), 66 return new ui::MouseEvent(event.type(),
69 target_location, 67 target_location,
70 target_root_location, 68 target_root_location,
71 event.flags()); 69 event.flags());
72 } 70 }
73 71
74 } // namespace internal 72 } // namespace internal
75 } // namespace ash 73 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698