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

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

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: safer shutdown (status_area_widget_) Created 7 years, 9 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 (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/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf_types.h" 9 #include "ash/shelf/shelf_types.h"
10 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
12 #include "ash/wm/panels/panel_layout_manager.h" 13 #include "ash/wm/panels/panel_layout_manager.h"
13 #include "ash/wm/property_util.h" 14 #include "ash/wm/property_util.h"
14 #include "ash/wm/window_properties.h" 15 #include "ash/wm/window_properties.h"
15 #include "ui/aura/client/aura_constants.h" 16 #include "ui/aura/client/aura_constants.h"
16 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
17 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
18 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
19 #include "ui/aura/window_delegate.h" 20 #include "ui/aura/window_delegate.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (panel_container_) { 96 if (panel_container_) {
96 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>( 97 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>(
97 panel_container_->layout_manager()); 98 panel_container_->layout_manager());
98 } 99 }
99 ash::Shell::GetInstance()->cursor_manager()->LockCursor(); 100 ash::Shell::GetInstance()->cursor_manager()->LockCursor();
100 } 101 }
101 102
102 bool PanelWindowResizer::AttachToLauncher(gfx::Rect* bounds) { 103 bool PanelWindowResizer::AttachToLauncher(gfx::Rect* bounds) {
103 bool should_attach = false; 104 bool should_attach = false;
104 if (panel_layout_manager_) { 105 if (panel_layout_manager_) {
105 gfx::Rect launcher_bounds = panel_layout_manager_->launcher()->widget()-> 106 gfx::Rect launcher_bounds = panel_layout_manager_->launcher()->
106 GetWindowBoundsInScreen(); 107 shelf_widget()->GetWindowBoundsInScreen();
107 switch (panel_layout_manager_->launcher()->alignment()) { 108 switch (panel_layout_manager_->launcher()->alignment()) {
108 case SHELF_ALIGNMENT_BOTTOM: 109 case SHELF_ALIGNMENT_BOTTOM:
109 if (bounds->bottom() >= (launcher_bounds.y() - 110 if (bounds->bottom() >= (launcher_bounds.y() -
110 kPanelSnapToLauncherDistance)) { 111 kPanelSnapToLauncherDistance)) {
111 should_attach = true; 112 should_attach = true;
112 bounds->set_y(launcher_bounds.y() - bounds->height()); 113 bounds->set_y(launcher_bounds.y() - bounds->height());
113 } 114 }
114 break; 115 break;
115 case SHELF_ALIGNMENT_LEFT: 116 case SHELF_ALIGNMENT_LEFT:
116 if (bounds->x() <= (launcher_bounds.right() + 117 if (bounds->x() <= (launcher_bounds.right() +
(...skipping 25 matching lines...) Expand all
142 if (was_attached_) 143 if (was_attached_)
143 panel_layout_manager_->StartDragging(details_.window); 144 panel_layout_manager_->StartDragging(details_.window);
144 } 145 }
145 146
146 void PanelWindowResizer::FinishDragging() { 147 void PanelWindowResizer::FinishDragging() {
147 if (was_attached_) 148 if (was_attached_)
148 panel_layout_manager_->FinishDragging(); 149 panel_layout_manager_->FinishDragging();
149 } 150 }
150 151
151 } // namespace aura 152 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager_unittest.cc ('k') | ash/wm/panels/panel_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698