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

Side by Side Diff: ash/common/wm/lock_window_state.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: Address review issues. Created 3 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
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/common/wm/lock_window_state.h" 5 #include "ash/common/wm/lock_window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/wm/lock_layout_manager.h" 9 #include "ash/common/wm/lock_layout_manager.h"
10 #include "ash/common/wm/window_animation_types.h" 10 #include "ash/common/wm/window_animation_types.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 if (current_state_type_ == target_state) { 136 if (current_state_type_ == target_state) {
137 // If the state type did not change, update it accordingly. 137 // If the state type did not change, update it accordingly.
138 UpdateBounds(window_state); 138 UpdateBounds(window_state);
139 return; 139 return;
140 } 140 }
141 141
142 const wm::WindowStateType old_state_type = current_state_type_; 142 const wm::WindowStateType old_state_type = current_state_type_;
143 current_state_type_ = target_state; 143 current_state_type_ = target_state;
144 window_state->UpdateWindowShowStateFromStateType(); 144 window_state->UpdateWindowPropertiesFromStateType();
145 window_state->NotifyPreStateTypeChange(old_state_type); 145 window_state->NotifyPreStateTypeChange(old_state_type);
146 UpdateBounds(window_state); 146 UpdateBounds(window_state);
147 window_state->NotifyPostStateTypeChange(old_state_type); 147 window_state->NotifyPostStateTypeChange(old_state_type);
148 148
149 if ((window_state->window()->GetTargetVisibility() || 149 if ((window_state->window()->GetTargetVisibility() ||
150 old_state_type == wm::WINDOW_STATE_TYPE_MINIMIZED) && 150 old_state_type == wm::WINDOW_STATE_TYPE_MINIMIZED) &&
151 !window_state->window()->GetLayer()->visible()) { 151 !window_state->window()->GetLayer()->visible()) {
152 // The layer may be hidden if the window was previously minimized. Make 152 // The layer may be hidden if the window was previously minimized. Make
153 // sure it's visible. 153 // sure it's visible.
154 window_state->window()->Show(); 154 window_state->window()->Show();
(...skipping 19 matching lines...) Expand all
174 keyboard_bounds = keyboard_controller->current_keyboard_bounds(); 174 keyboard_bounds = keyboard_controller->current_keyboard_bounds();
175 } 175 }
176 gfx::Rect bounds = wm::GetDisplayBoundsWithShelf(window_state->window()); 176 gfx::Rect bounds = wm::GetDisplayBoundsWithShelf(window_state->window());
177 bounds.set_height(bounds.height() - keyboard_bounds.height()); 177 bounds.set_height(bounds.height() - keyboard_bounds.height());
178 178
179 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); 179 VLOG(1) << "Updating window bounds to: " << bounds.ToString();
180 window_state->SetBoundsDirect(bounds); 180 window_state->SetBoundsDirect(bounds);
181 } 181 }
182 182
183 } // namespace ash 183 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/default_state.cc ('k') | ash/common/wm/maximize_mode/maximize_mode_window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698