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

Side by Side Diff: ash/wm/panels/panel_window_resizer.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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/panels/panel_layout_manager_unittest.cc ('k') | ash/wm/window_animations.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/panels/panel_window_resizer.h" 5 #include "ash/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/display/window_tree_host_manager.h" 7 #include "ash/display/window_tree_host_manager.h"
8 #include "ash/screen_util.h" 8 #include "ash/screen_util.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 bool should_attach = false; 133 bool should_attach = false;
134 if (panel_container_) { 134 if (panel_container_) {
135 PanelLayoutManager* panel_layout_manager = 135 PanelLayoutManager* panel_layout_manager =
136 GetPanelLayoutManager(panel_container_); 136 GetPanelLayoutManager(panel_container_);
137 gfx::Rect launcher_bounds = ScreenUtil::ConvertRectFromScreen( 137 gfx::Rect launcher_bounds = ScreenUtil::ConvertRectFromScreen(
138 GetTarget()->parent(), 138 GetTarget()->parent(),
139 panel_layout_manager->shelf()-> 139 panel_layout_manager->shelf()->
140 shelf_widget()->GetWindowBoundsInScreen()); 140 shelf_widget()->GetWindowBoundsInScreen());
141 switch (panel_layout_manager->shelf()->alignment()) { 141 switch (panel_layout_manager->shelf()->alignment()) {
142 case SHELF_ALIGNMENT_BOTTOM: 142 case SHELF_ALIGNMENT_BOTTOM:
143 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
143 if (bounds.bottom() >= (launcher_bounds.y() - 144 if (bounds.bottom() >= (launcher_bounds.y() -
144 kPanelSnapToLauncherDistance)) { 145 kPanelSnapToLauncherDistance)) {
145 should_attach = true; 146 should_attach = true;
146 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y()); 147 offset->set_y(launcher_bounds.y() - bounds.height() - bounds.y());
147 } 148 }
148 break; 149 break;
149 case SHELF_ALIGNMENT_LEFT: 150 case SHELF_ALIGNMENT_LEFT:
150 if (bounds.x() <= (launcher_bounds.right() + 151 if (bounds.x() <= (launcher_bounds.right() +
151 kPanelSnapToLauncherDistance)) { 152 kPanelSnapToLauncherDistance)) {
152 should_attach = true; 153 should_attach = true;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 210 }
210 211
211 void PanelWindowResizer::UpdateLauncherPosition() { 212 void PanelWindowResizer::UpdateLauncherPosition() {
212 if (panel_container_) { 213 if (panel_container_) {
213 GetPanelLayoutManager(panel_container_)->shelf()-> 214 GetPanelLayoutManager(panel_container_)->shelf()->
214 UpdateIconPositionForWindow(GetTarget()); 215 UpdateIconPositionForWindow(GetTarget());
215 } 216 }
216 } 217 }
217 218
218 } // namespace aura 219 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager_unittest.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698