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

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

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 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
« no previous file with comments | « ash/wm/drag_details.h ('k') | ash/wm/gestures/shelf_gesture_handler.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/drag_details.h" 5 #include "ash/wm/drag_details.h"
6 6
7 #include "ash/wm/common/wm_window.h"
7 #include "ash/wm/window_resizer.h" 8 #include "ash/wm/window_resizer.h"
8 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
9 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
10 11
11 namespace ash { 12 namespace ash {
12 13
13 namespace { 14 namespace {
14 15
15 int GetSizeChangeDirectionForWindowComponent(int window_component) { 16 int GetSizeChangeDirectionForWindowComponent(int window_component) {
16 int size_change_direction = WindowResizer::kBoundsChangeDirection_None; 17 int size_change_direction = WindowResizer::kBoundsChangeDirection_None;
(...skipping 17 matching lines...) Expand all
34 size_change_direction |= WindowResizer::kBoundsChangeDirection_Horizontal; 35 size_change_direction |= WindowResizer::kBoundsChangeDirection_Horizontal;
35 break; 36 break;
36 default: 37 default:
37 break; 38 break;
38 } 39 }
39 return size_change_direction; 40 return size_change_direction;
40 } 41 }
41 42
42 } // namespace 43 } // namespace
43 44
44 DragDetails::DragDetails(aura::Window* window, 45 DragDetails::DragDetails(wm::WmWindow* window,
45 const gfx::Point& location, 46 const gfx::Point& location,
46 int window_component, 47 int window_component,
47 aura::client::WindowMoveSource source) 48 aura::client::WindowMoveSource source)
48 : initial_state_type(wm::GetWindowState(window)->GetStateType()), 49 : initial_state_type(window->GetWindowState()->GetStateType()),
49 initial_bounds_in_parent(window->bounds()), 50 initial_bounds_in_parent(window->GetBounds()),
50 initial_location_in_parent(location), 51 initial_location_in_parent(location),
51 initial_opacity(window->layer()->opacity()), 52 initial_opacity(window->GetLayer()->opacity()),
52 window_component(window_component), 53 window_component(window_component),
53 bounds_change( 54 bounds_change(
54 WindowResizer::GetBoundsChangeForWindowComponent(window_component)), 55 WindowResizer::GetBoundsChangeForWindowComponent(window_component)),
55 position_change_direction( 56 position_change_direction(
56 WindowResizer::GetPositionChangeDirectionForWindowComponent( 57 WindowResizer::GetPositionChangeDirectionForWindowComponent(
57 window_component)), 58 window_component)),
58 size_change_direction( 59 size_change_direction(
59 GetSizeChangeDirectionForWindowComponent(window_component)), 60 GetSizeChangeDirectionForWindowComponent(window_component)),
60 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None), 61 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None),
61 source(source), 62 source(source),
62 should_attach_to_shelf(window->type() == ui::wm::WINDOW_TYPE_PANEL && 63 should_attach_to_shelf(window->GetType() == ui::wm::WINDOW_TYPE_PANEL &&
63 wm::GetWindowState(window)->panel_attached()) { 64 window->GetWindowState()->panel_attached()) {
64 wm::WindowState* window_state = wm::GetWindowState(window); 65 wm::WindowState* window_state = window->GetWindowState();
65 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) && 66 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) &&
66 window_state->HasRestoreBounds() && 67 window_state->HasRestoreBounds() &&
67 window_component == HTCAPTION) { 68 window_component == HTCAPTION) {
68 restore_bounds = window_state->GetRestoreBoundsInScreen(); 69 restore_bounds = window_state->GetRestoreBoundsInScreen();
69 } 70 }
70 } 71 }
71 72
72 DragDetails::~DragDetails() { 73 DragDetails::~DragDetails() {
73 } 74 }
74 75
75 } // namespace ash 76 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_details.h ('k') | ash/wm/gestures/shelf_gesture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698