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

Side by Side Diff: ash/wm/default_window_resizer.cc

Issue 10834097: Allow the user to drag a window from one display to another (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 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
« no previous file with comments | « no previous file | ash/wm/window_resizer.h » ('j') | ash/wm/workspace/workspace_window_resizer.cc » ('J')
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/wm/default_window_resizer.h" 5 #include "ash/wm/default_window_resizer.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/cursor_manager.h" 8 #include "ash/wm/cursor_manager.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 29 matching lines...) Expand all
40 if (current_root != details_.window->GetRootWindow()) 40 if (current_root != details_.window->GetRootWindow())
41 return; 41 return;
42 42
43 gfx::Point location_in_root = location_in_screen; 43 gfx::Point location_in_root = location_in_screen;
44 aura::client::GetScreenPositionClient(current_root)-> 44 aura::client::GetScreenPositionClient(current_root)->
45 ConvertPointFromScreen(current_root, &location_in_root); 45 ConvertPointFromScreen(current_root, &location_in_root);
46 46
47 int grid_size = event_flags & ui::EF_CONTROL_DOWN ? 47 int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
48 0 : ash::Shell::GetInstance()->GetGridSize(); 48 0 : ash::Shell::GetInstance()->GetGridSize();
49 gfx::Rect bounds( 49 gfx::Rect bounds(
50 CalculateBoundsForDrag(details_, location_in_root, grid_size)); 50 CalculateBoundsForDrag(details_, location_in_screen, grid_size));
51 if (bounds != details_.window->bounds()) { 51 if (bounds != details_.window->bounds()) {
52 did_move_or_resize_ = true; 52 did_move_or_resize_ = true;
53 details_.window->SetBounds(bounds); 53 details_.window->SetBounds(bounds);
54 } 54 }
55 } 55 }
56 56
57 void DefaultWindowResizer::CompleteDrag(int event_flags) { 57 void DefaultWindowResizer::CompleteDrag(int event_flags) {
58 int grid_size = event_flags & ui::EF_CONTROL_DOWN ? 58 int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
59 0 : ash::Shell::GetInstance()->GetGridSize(); 59 0 : ash::Shell::GetInstance()->GetGridSize();
60 if (grid_size <= 1 || !did_move_or_resize_) 60 if (grid_size <= 1 || !did_move_or_resize_)
(...skipping 24 matching lines...) Expand all
85 } 85 }
86 86
87 DefaultWindowResizer::DefaultWindowResizer(const Details& details) 87 DefaultWindowResizer::DefaultWindowResizer(const Details& details)
88 : details_(details), 88 : details_(details),
89 did_move_or_resize_(false) { 89 did_move_or_resize_(false) {
90 DCHECK(details_.is_resizable); 90 DCHECK(details_.is_resizable);
91 ash::Shell::GetInstance()->cursor_manager()->LockCursor(); 91 ash::Shell::GetInstance()->cursor_manager()->LockCursor();
92 } 92 }
93 93
94 } // namespace aura 94 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_resizer.h » ('j') | ash/wm/workspace/workspace_window_resizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698