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

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

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/panel_window_resizer.h" 5 #include "ash/wm/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/shelf_widget.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
11 #include "ash/wm/panel_layout_manager.h" 12 #include "ash/wm/panel_layout_manager.h"
12 #include "ash/wm/property_util.h" 13 #include "ash/wm/property_util.h"
13 #include "ash/wm/window_properties.h" 14 #include "ash/wm/window_properties.h"
14 #include "ui/aura/client/aura_constants.h" 15 #include "ui/aura/client/aura_constants.h"
15 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
16 #include "ui/aura/root_window.h" 17 #include "ui/aura/root_window.h"
17 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
18 #include "ui/aura/window_delegate.h" 19 #include "ui/aura/window_delegate.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (panel_container_) { 95 if (panel_container_) {
95 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>( 96 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>(
96 panel_container_->layout_manager()); 97 panel_container_->layout_manager());
97 } 98 }
98 ash::Shell::GetInstance()->cursor_manager()->LockCursor(); 99 ash::Shell::GetInstance()->cursor_manager()->LockCursor();
99 } 100 }
100 101
101 bool PanelWindowResizer::AttachToLauncher(gfx::Rect* bounds) { 102 bool PanelWindowResizer::AttachToLauncher(gfx::Rect* bounds) {
102 bool should_attach = false; 103 bool should_attach = false;
103 if (panel_layout_manager_) { 104 if (panel_layout_manager_) {
104 int launcher_top = panel_layout_manager_->launcher()->widget()-> 105 int launcher_top = panel_layout_manager_->launcher()->
105 GetWindowBoundsInScreen().y(); 106 shelf_widget()->GetWindowBoundsInScreen().y();
106 if (bounds->y() >= (launcher_top - bounds->height() - 107 if (bounds->y() >= (launcher_top - bounds->height() -
107 kPanelSnapToLauncherDistance)) { 108 kPanelSnapToLauncherDistance)) {
108 should_attach = true; 109 should_attach = true;
109 bounds->set_y(launcher_top - bounds->height()); 110 bounds->set_y(launcher_top - bounds->height());
110 } 111 }
111 } 112 }
112 return should_attach; 113 return should_attach;
113 } 114 }
114 115
115 void PanelWindowResizer::StartedDragging() { 116 void PanelWindowResizer::StartedDragging() {
116 if (was_attached_) 117 if (was_attached_)
117 panel_layout_manager_->StartDragging(details_.window); 118 panel_layout_manager_->StartDragging(details_.window);
118 } 119 }
119 120
120 void PanelWindowResizer::FinishDragging() { 121 void PanelWindowResizer::FinishDragging() {
121 if (was_attached_) 122 if (was_attached_)
122 panel_layout_manager_->FinishDragging(); 123 panel_layout_manager_->FinishDragging();
123 } 124 }
124 125
125 } // namespace aura 126 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698