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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase fix Created 7 years, 3 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 "chrome/browser/ui/views/tabs/tab_drag_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "ui/gfx/canvas.h" 45 #include "ui/gfx/canvas.h"
46 #include "ui/gfx/image/image_skia.h" 46 #include "ui/gfx/image/image_skia.h"
47 #include "ui/gfx/screen.h" 47 #include "ui/gfx/screen.h"
48 #include "ui/views/focus/view_storage.h" 48 #include "ui/views/focus/view_storage.h"
49 #include "ui/views/widget/root_view.h" 49 #include "ui/views/widget/root_view.h"
50 #include "ui/views/widget/widget.h" 50 #include "ui/views/widget/widget.h"
51 51
52 #if defined(USE_ASH) 52 #if defined(USE_ASH)
53 #include "ash/shell.h" 53 #include "ash/shell.h"
54 #include "ash/wm/coordinate_conversion.h" 54 #include "ash/wm/coordinate_conversion.h"
55 #include "ash/wm/window_settings.h" 55 #include "ash/wm/window_state.h"
56 #include "ui/aura/env.h" 56 #include "ui/aura/env.h"
57 #include "ui/aura/root_window.h" 57 #include "ui/aura/root_window.h"
58 #include "ui/base/gestures/gesture_recognizer.h" 58 #include "ui/base/gestures/gesture_recognizer.h"
59 #endif 59 #endif
60 60
61 using content::OpenURLParams; 61 using content::OpenURLParams;
62 using content::UserMetricsAction; 62 using content::UserMetricsAction;
63 using content::WebContents; 63 using content::WebContents;
64 64
65 static const int kHorizontalMoveThreshold = 16; // Pixels. 65 static const int kHorizontalMoveThreshold = 16; // Pixels.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 canvas->DrawImageInt(image, x, y, paint); 186 canvas->DrawImageInt(image, x, y, paint);
187 } 187 }
188 188
189 DockInfo::Type type_; 189 DockInfo::Type type_;
190 190
191 DISALLOW_COPY_AND_ASSIGN(DockView); 191 DISALLOW_COPY_AND_ASSIGN(DockView);
192 }; 192 };
193 193
194 void SetTrackedByWorkspace(gfx::NativeWindow window, bool value) { 194 void SetTrackedByWorkspace(gfx::NativeWindow window, bool value) {
195 #if defined(USE_ASH) 195 #if defined(USE_ASH)
196 ash::wm::GetWindowSettings(window)->SetTrackedByWorkspace(value); 196 ash::wm::GetWindowState(window)->SetTrackedByWorkspace(value);
197 #endif 197 #endif
198 } 198 }
199 199
200 void SetWindowPositionManaged(gfx::NativeWindow window, bool value) { 200 void SetWindowPositionManaged(gfx::NativeWindow window, bool value) {
201 #if defined(USE_ASH) 201 #if defined(USE_ASH)
202 ash::wm::GetWindowSettings(window)->set_window_position_managed(value); 202 ash::wm::GetWindowState(window)->set_window_position_managed(value);
203 #endif 203 #endif
204 } 204 }
205 205
206 // Returns true if |bounds| contains the y-coordinate |y|. The y-coordinate 206 // Returns true if |bounds| contains the y-coordinate |y|. The y-coordinate
207 // of |bounds| is adjusted by |vertical_adjustment|. 207 // of |bounds| is adjusted by |vertical_adjustment|.
208 bool DoesRectContainVerticalPointExpanded( 208 bool DoesRectContainVerticalPointExpanded(
209 const gfx::Rect& bounds, 209 const gfx::Rect& bounds,
210 int vertical_adjustment, 210 int vertical_adjustment,
211 int y) { 211 int y) {
212 int upper_threshold = bounds.bottom() + vertical_adjustment; 212 int upper_threshold = bounds.bottom() + vertical_adjustment;
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 gfx::Vector2d TabDragController::GetWindowOffset( 2184 gfx::Vector2d TabDragController::GetWindowOffset(
2185 const gfx::Point& point_in_screen) { 2185 const gfx::Point& point_in_screen) {
2186 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? 2186 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ?
2187 attached_tabstrip_ : source_tabstrip_; 2187 attached_tabstrip_ : source_tabstrip_;
2188 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); 2188 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView();
2189 2189
2190 gfx::Point point = point_in_screen; 2190 gfx::Point point = point_in_screen;
2191 views::View::ConvertPointFromScreen(toplevel_view, &point); 2191 views::View::ConvertPointFromScreen(toplevel_view, &point);
2192 return point.OffsetFromOrigin(); 2192 return point.OffsetFromOrigin();
2193 } 2193 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698