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

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

Issue 2268823002: mash: Move more shelf files to ash/common/shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase. Created 4 years, 4 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/common/shelf/shelf.h ('k') | ash/common/shelf/shelf_layout_manager.h » ('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 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/common/shelf/shelf.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "ash/aura/wm_window_aura.h"
11 #include "ash/common/shelf/shelf_delegate.h" 10 #include "ash/common/shelf/shelf_delegate.h"
12 #include "ash/common/shelf/shelf_item_delegate.h" 11 #include "ash/common/shelf/shelf_item_delegate.h"
12 #include "ash/common/shelf/shelf_layout_manager.h"
13 #include "ash/common/shelf/shelf_model.h" 13 #include "ash/common/shelf/shelf_model.h"
14 #include "ash/common/shelf/shelf_navigator.h" 14 #include "ash/common/shelf/shelf_navigator.h"
15 #include "ash/common/shelf/shelf_view.h" 15 #include "ash/common/shelf/shelf_view.h"
16 #include "ash/common/shelf/wm_shelf.h"
16 #include "ash/common/shell_window_ids.h" 17 #include "ash/common/shell_window_ids.h"
17 #include "ash/common/wm_lookup.h" 18 #include "ash/common/wm_lookup.h"
19 #include "ash/common/wm_root_window_controller.h"
18 #include "ash/common/wm_shell.h" 20 #include "ash/common/wm_shell.h"
21 #include "ash/common/wm_window.h"
19 #include "ash/common/wm_window_property.h" 22 #include "ash/common/wm_window_property.h"
20 #include "ash/root_window_controller.h"
21 #include "ash/shelf/shelf_layout_manager.h"
22 #include "ui/aura/window.h"
23 #include "ui/compositor/layer.h" 23 #include "ui/compositor/layer.h"
24 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/image/image.h" 25 #include "ui/gfx/image/image.h"
26 #include "ui/gfx/image/image_skia_operations.h" 26 #include "ui/gfx/image/image_skia_operations.h"
27 #include "ui/gfx/skbitmap_operations.h" 27 #include "ui/gfx/skbitmap_operations.h"
28 #include "ui/views/accessible_pane_view.h" 28 #include "ui/views/accessible_pane_view.h"
29 #include "ui/views/widget/widget.h" 29 #include "ui/views/widget/widget.h"
30 #include "ui/views/widget/widget_delegate.h" 30 #include "ui/views/widget/widget_delegate.h"
31 #include "ui/wm/public/activation_client.h" 31 #include "ui/wm/public/activation_client.h"
32 32
(...skipping 14 matching lines...) Expand all
47 Shelf::~Shelf() { 47 Shelf::~Shelf() {
48 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this); 48 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this);
49 } 49 }
50 50
51 // static 51 // static
52 Shelf* Shelf::ForPrimaryDisplay() { 52 Shelf* Shelf::ForPrimaryDisplay() {
53 return Shelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow()); 53 return Shelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow());
54 } 54 }
55 55
56 // static 56 // static
57 Shelf* Shelf::ForWindow(const WmWindow* window) { 57 Shelf* Shelf::ForWindow(WmWindow* window) {
58 const aura::Window* aura_window = WmWindowAura::GetAuraWindow(window); 58 return window->GetRootWindowController()->GetShelf()->shelf();
59 ShelfWidget* shelf_widget =
60 RootWindowController::ForWindow(aura_window)->shelf_widget();
61 return shelf_widget ? shelf_widget->shelf() : nullptr;
62 } 59 }
63 60
64 void Shelf::SetAlignment(ShelfAlignment alignment) { 61 void Shelf::SetAlignment(ShelfAlignment alignment) {
65 if (alignment_ == alignment) 62 if (alignment_ == alignment)
66 return; 63 return;
67 64
68 if (shelf_locking_manager_.is_locked() && 65 if (shelf_locking_manager_.is_locked() &&
69 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { 66 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) {
70 shelf_locking_manager_.set_stored_alignment(alignment); 67 shelf_locking_manager_.set_stored_alignment(alignment);
71 return; 68 return;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 168
172 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { 169 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() {
173 return shelf_view_; 170 return shelf_view_;
174 } 171 }
175 172
176 void Shelf::UpdateShelfItemBackground(int alpha) { 173 void Shelf::UpdateShelfItemBackground(int alpha) {
177 shelf_view_->UpdateShelfItemBackground(alpha); 174 shelf_view_->UpdateShelfItemBackground(alpha);
178 } 175 }
179 176
180 } // namespace ash 177 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf.h ('k') | ash/common/shelf/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698