| OLD | NEW |
| 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_SHELF_SHELF_H_ | 5 #ifndef ASH_SHELF_SHELF_H_ |
| 6 #define ASH_SHELF_SHELF_H_ | 6 #define ASH_SHELF_SHELF_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Controller for shelf state. All access to state (visibility, auto-hide, etc.) | 50 // Controller for shelf state. All access to state (visibility, auto-hide, etc.) |
| 51 // should occur via this class. | 51 // should occur via this class. |
| 52 class ASH_EXPORT Shelf { | 52 class ASH_EXPORT Shelf { |
| 53 public: | 53 public: |
| 54 static const char kNativeViewName[]; | 54 static const char kNativeViewName[]; |
| 55 | 55 |
| 56 Shelf(ShelfModel* model, | 56 Shelf(ShelfModel* model, |
| 57 WmShelf* wm_shelf, | 57 WmShelf* wm_shelf, |
| 58 ShelfWidget* widget); | 58 ShelfWidget* widget); |
| 59 virtual ~Shelf(); | 59 ~Shelf(); |
| 60 | 60 |
| 61 // Return the shelf for the primary display. NULL if no user is logged in yet. | 61 // Return the shelf for the primary display. NULL if no user is logged in yet. |
| 62 // Useful for tests. For production code use ForWindow() because the user may | 62 // Useful for tests. For production code use ForWindow() because the user may |
| 63 // have multiple displays. | 63 // have multiple displays. |
| 64 static Shelf* ForPrimaryDisplay(); | 64 static Shelf* ForPrimaryDisplay(); |
| 65 | 65 |
| 66 // Return the shelf for the display that |window| is currently on, or a shelf | 66 // Return the shelf for the display that |window| is currently on, or a shelf |
| 67 // on primary display if the shelf per display feature is disabled. NULL if no | 67 // on primary display if the shelf per display feature is disabled. NULL if no |
| 68 // user is logged in yet. | 68 // user is logged in yet. |
| 69 static Shelf* ForWindow(const aura::Window* window); | 69 static Shelf* ForWindow(const aura::Window* window); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return shelf_widget_->shelf_layout_manager(); | 145 return shelf_widget_->shelf_layout_manager(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Returns rectangle bounding all visible shelf items. Used screen coordinate | 148 // Returns rectangle bounding all visible shelf items. Used screen coordinate |
| 149 // system. | 149 // system. |
| 150 gfx::Rect GetVisibleItemsBoundsInScreen() const; | 150 gfx::Rect GetVisibleItemsBoundsInScreen() const; |
| 151 | 151 |
| 152 // Returns ApplicationDragAndDropHost for this shelf. | 152 // Returns ApplicationDragAndDropHost for this shelf. |
| 153 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); | 153 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); |
| 154 | 154 |
| 155 // Updates the background for the shelf items. |
| 156 void UpdateShelfItemBackground(int alpha); |
| 157 |
| 155 ShelfLockingManager* shelf_locking_manager_for_testing() { | 158 ShelfLockingManager* shelf_locking_manager_for_testing() { |
| 156 return &shelf_locking_manager_; | 159 return &shelf_locking_manager_; |
| 157 } | 160 } |
| 158 | 161 |
| 159 ShelfView* shelf_view_for_testing() { return shelf_view_; } | 162 ShelfView* shelf_view_for_testing() { return shelf_view_; } |
| 160 | 163 |
| 161 private: | 164 private: |
| 162 friend class test::ShelfTestAPI; | 165 friend class test::ShelfTestAPI; |
| 163 | 166 |
| 164 // The shelf controller. Owned by the root window controller. | 167 // The shelf controller. Owned by the root window controller. |
| 165 WmShelf* wm_shelf_; | 168 WmShelf* wm_shelf_; |
| 166 ShelfWidget* shelf_widget_; | 169 ShelfWidget* shelf_widget_; |
| 167 ShelfView* shelf_view_; | 170 ShelfView* shelf_view_; |
| 168 ShelfLockingManager shelf_locking_manager_; | 171 ShelfLockingManager shelf_locking_manager_; |
| 169 | 172 |
| 170 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM; | 173 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM; |
| 171 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 174 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
| 172 | 175 |
| 173 DISALLOW_COPY_AND_ASSIGN(Shelf); | 176 DISALLOW_COPY_AND_ASSIGN(Shelf); |
| 174 }; | 177 }; |
| 175 | 178 |
| 176 } // namespace ash | 179 } // namespace ash |
| 177 | 180 |
| 178 #endif // ASH_SHELF_SHELF_H_ | 181 #endif // ASH_SHELF_SHELF_H_ |
| OLD | NEW |