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

Side by Side Diff: ash/shelf/shelf.cc

Issue 1929023002: Refactors WindowResizers to use ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shelf/shelf.h" 5 #include "ash/shelf/shelf.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "ash/focus_cycler.h" 10 #include "ash/focus_cycler.h"
11 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
12 #include "ash/screen_util.h" 12 #include "ash/screen_util.h"
13 #include "ash/shelf/shelf_delegate.h" 13 #include "ash/shelf/shelf_delegate.h"
14 #include "ash/shelf/shelf_item_delegate.h" 14 #include "ash/shelf/shelf_item_delegate.h"
15 #include "ash/shelf/shelf_item_delegate_manager.h" 15 #include "ash/shelf/shelf_item_delegate_manager.h"
16 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
17 #include "ash/shelf/shelf_model.h" 17 #include "ash/shelf/shelf_model.h"
18 #include "ash/shelf/shelf_navigator.h" 18 #include "ash/shelf/shelf_navigator.h"
19 #include "ash/shelf/shelf_util.h" 19 #include "ash/shelf/shelf_util.h"
20 #include "ash/shelf/shelf_view.h" 20 #include "ash/shelf/shelf_view.h"
21 #include "ash/shell.h" 21 #include "ash/shell.h"
22 #include "ash/shell_delegate.h" 22 #include "ash/shell_delegate.h"
23 #include "ash/shell_window_ids.h" 23 #include "ash/shell_window_ids.h"
24 #include "ash/wm/aura/wm_shelf_aura.h" 24 #include "ash/wm/aura/wm_shelf_aura.h"
25 #include "ash/wm/common/shelf/wm_shelf_util.h"
25 #include "ash/wm/window_properties.h" 26 #include "ash/wm/window_properties.h"
26 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
27 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
28 #include "ui/aura/window_observer.h" 29 #include "ui/aura/window_observer.h"
29 #include "ui/compositor/layer.h" 30 #include "ui/compositor/layer.h"
30 #include "ui/gfx/canvas.h" 31 #include "ui/gfx/canvas.h"
31 #include "ui/gfx/image/image.h" 32 #include "ui/gfx/image/image.h"
32 #include "ui/gfx/image/image_skia_operations.h" 33 #include "ui/gfx/image/image_skia_operations.h"
33 #include "ui/gfx/skbitmap_operations.h" 34 #include "ui/gfx/skbitmap_operations.h"
34 #include "ui/views/accessible_pane_view.h" 35 #include "ui/views/accessible_pane_view.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 alignment_ = alignment; 84 alignment_ = alignment;
84 shelf_view_->OnShelfAlignmentChanged(); 85 shelf_view_->OnShelfAlignmentChanged();
85 shelf_widget_->OnShelfAlignmentChanged(); 86 shelf_widget_->OnShelfAlignmentChanged();
86 delegate_->OnShelfAlignmentChanged(this); 87 delegate_->OnShelfAlignmentChanged(this);
87 Shell::GetInstance()->OnShelfAlignmentChanged( 88 Shell::GetInstance()->OnShelfAlignmentChanged(
88 shelf_widget_->GetNativeWindow()->GetRootWindow()); 89 shelf_widget_->GetNativeWindow()->GetRootWindow());
89 // ShelfLayoutManager will resize the shelf. 90 // ShelfLayoutManager will resize the shelf.
90 } 91 }
91 92
92 bool Shelf::IsHorizontalAlignment() const { 93 bool Shelf::IsHorizontalAlignment() const {
93 return ash::IsHorizontalAlignment(alignment_); 94 return wm::IsHorizontalAlignment(alignment_);
94 } 95 }
95 96
96 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { 97 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
97 if (auto_hide_behavior_ == auto_hide_behavior) 98 if (auto_hide_behavior_ == auto_hide_behavior)
98 return; 99 return;
99 100
100 auto_hide_behavior_ = auto_hide_behavior; 101 auto_hide_behavior_ = auto_hide_behavior;
101 delegate_->OnShelfAutoHideBehaviorChanged(this); 102 delegate_->OnShelfAutoHideBehaviorChanged(this);
102 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged( 103 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged(
103 shelf_widget_->GetNativeWindow()->GetRootWindow()); 104 shelf_widget_->GetNativeWindow()->GetRootWindow());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 208
208 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { 209 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const {
209 return shelf_view_->GetVisibleItemsBoundsInScreen(); 210 return shelf_view_->GetVisibleItemsBoundsInScreen();
210 } 211 }
211 212
212 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { 213 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() {
213 return shelf_view_; 214 return shelf_view_;
214 } 215 }
215 216
216 } // namespace ash 217 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698