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

Side by Side Diff: ash/wm/gestures/system_pinch_handler.cc

Issue 11280283: Extract the code of showing a dragging window on another display from PhantomWindowController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: assign NULL after deleting Layer Created 8 years 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 | « ash/wm/drag_window_controller.cc ('k') | ash/wm/workspace/frame_maximize_button.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 (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/gestures/system_pinch_handler.h" 5 #include "ash/wm/gestures/system_pinch_handler.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/property_util.h" 10 #include "ash/wm/property_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 return SYSTEM_GESTURE_END; 67 return SYSTEM_GESTURE_END;
68 } 68 }
69 69
70 case ui::ET_GESTURE_PINCH_UPDATE: { 70 case ui::ET_GESTURE_PINCH_UPDATE: {
71 // The PINCH_UPDATE events contain incremental scaling updates. 71 // The PINCH_UPDATE events contain incremental scaling updates.
72 pinch_factor_ *= event.details().scale(); 72 pinch_factor_ *= event.details().scale();
73 gfx::Rect bounds = 73 gfx::Rect bounds =
74 GetPhantomWindowScreenBounds(target_, event.location()); 74 GetPhantomWindowScreenBounds(target_, event.location());
75 if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing()) 75 if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing())
76 phantom_.Show(bounds, NULL); 76 phantom_.Show(bounds);
77 break; 77 break;
78 } 78 }
79 79
80 case ui::ET_GESTURE_MULTIFINGER_SWIPE: { 80 case ui::ET_GESTURE_MULTIFINGER_SWIPE: {
81 phantom_.Hide(); 81 phantom_.Hide();
82 pinch_factor_ = 1.0; 82 pinch_factor_ = 1.0;
83 phantom_state_ = PHANTOM_WINDOW_NORMAL; 83 phantom_state_ = PHANTOM_WINDOW_NORMAL;
84 84
85 if (event.details().swipe_left() || event.details().swipe_right()) { 85 if (event.details().swipe_left() || event.details().swipe_right()) {
86 // Snap for left/right swipes. 86 // Snap for left/right swipes.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 phantom_state_ = PHANTOM_WINDOW_MINIMIZED; 137 phantom_state_ = PHANTOM_WINDOW_MINIMIZED;
138 return rect; 138 return rect;
139 } 139 }
140 140
141 phantom_state_ = PHANTOM_WINDOW_NORMAL; 141 phantom_state_ = PHANTOM_WINDOW_NORMAL;
142 return window->bounds(); 142 return window->bounds();
143 } 143 }
144 144
145 } // namespace internal 145 } // namespace internal
146 } // namespace ash 146 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_controller.cc ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698