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

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

Issue 2274333002: ash: Move more code from Shelf to WmShelf (Closed)
Patch Set: review comments Created 4 years, 3 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/ash.gyp ('k') | ash/common/shelf/shelf.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 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 #ifndef ASH_COMMON_SHELF_SHELF_H_ 5 #ifndef ASH_COMMON_SHELF_SHELF_H_
6 #define ASH_COMMON_SHELF_SHELF_H_ 6 #define ASH_COMMON_SHELF_SHELF_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/shelf_types.h"
11 #include "ash/common/shelf/shelf_widget.h" 9 #include "ash/common/shelf/shelf_widget.h"
12 #include "base/macros.h" 10 #include "base/macros.h"
13 11
14 namespace app_list { 12 namespace app_list {
15 class ApplicationDragAndDropHost; 13 class ApplicationDragAndDropHost;
16 } 14 }
17 15
18 namespace gfx { 16 namespace gfx {
19 class Rect; 17 class Rect;
20 } 18 }
(...skipping 22 matching lines...) Expand all
43 41
44 // Return the shelf for the display that |window| is currently on, or a shelf 42 // Return the shelf for the display that |window| is currently on, or a shelf
45 // on primary display if the shelf per display feature is disabled. NULL if no 43 // on primary display if the shelf per display feature is disabled. NULL if no
46 // user is logged in yet. 44 // user is logged in yet.
47 static Shelf* ForWindow(WmWindow* window); 45 static Shelf* ForWindow(WmWindow* window);
48 46
49 // For porting from Shelf to WmShelf. 47 // For porting from Shelf to WmShelf.
50 // TODO(jamescook): Remove this. 48 // TODO(jamescook): Remove this.
51 WmShelf* wm_shelf() { return wm_shelf_; } 49 WmShelf* wm_shelf() { return wm_shelf_; }
52 50
53 // Returns the screen bounds of the item for the specified window. If there is
54 // no item for the specified window an empty rect is returned.
55 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window);
56
57 // Updates the icon position given the current window bounds. This is used
58 // when dragging panels to reposition them with respect to the other panels.
59 void UpdateIconPositionForWindow(WmWindow* window);
60
61 // Activates the the shelf item specified by the index in the list of shelf
62 // items.
63 void ActivateShelfItem(int index);
64
65 // Cycles the window focus linearly over the current shelf items.
66 void CycleWindowLinear(CycleDirection direction);
67
68 AppListButton* GetAppListButton() const; 51 AppListButton* GetAppListButton() const;
69 52
70 // Launch a 0-indexed shelf item in the shelf.
71 // A negative index launches the last shelf item in the shelf.
72 void LaunchAppIndexAt(int item_index);
73
74 ShelfWidget* shelf_widget() { return shelf_widget_; } 53 ShelfWidget* shelf_widget() { return shelf_widget_; }
75 54
76 // TODO(msw): ShelfLayoutManager should not be accessed externally. 55 // TODO(msw): ShelfLayoutManager should not be accessed externally.
77 ShelfLayoutManager* shelf_layout_manager() { 56 ShelfLayoutManager* shelf_layout_manager() {
78 return shelf_widget_->shelf_layout_manager(); 57 return shelf_widget_->shelf_layout_manager();
79 } 58 }
80 59
81 // Returns rectangle bounding all visible shelf items. Used screen coordinate
82 // system.
83 gfx::Rect GetVisibleItemsBoundsInScreen() const;
84
85 // Returns ApplicationDragAndDropHost for this shelf. 60 // Returns ApplicationDragAndDropHost for this shelf.
86 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); 61 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList();
87 62
88 // Updates the background for the shelf items.
89 void UpdateShelfItemBackground(int alpha);
90
91 ShelfView* shelf_view_for_testing() { return shelf_view_; } 63 ShelfView* shelf_view_for_testing() { return shelf_view_; }
92 64
93 private: 65 private:
94 friend class test::ShelfTestAPI; 66 friend class test::ShelfTestAPI;
95 67
96 // The shelf controller. Owned by the root window controller. 68 // The shelf controller. Owned by the root window controller.
97 WmShelf* wm_shelf_; 69 WmShelf* wm_shelf_;
98 ShelfWidget* shelf_widget_; 70 ShelfWidget* shelf_widget_;
99 ShelfView* shelf_view_; 71 ShelfView* shelf_view_;
100 72
101 DISALLOW_COPY_AND_ASSIGN(Shelf); 73 DISALLOW_COPY_AND_ASSIGN(Shelf);
102 }; 74 };
103 75
104 } // namespace ash 76 } // namespace ash
105 77
106 #endif // ASH_COMMON_SHELF_SHELF_H_ 78 #endif // ASH_COMMON_SHELF_SHELF_H_
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/shelf/shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698