| OLD | NEW |
| 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 #ifndef ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| 6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/launcher/launcher_button_host.h" | 12 #include "ash/launcher/launcher_button_host.h" |
| 13 #include "ash/launcher/launcher_model_observer.h" | 13 #include "ash/launcher/launcher_model_observer.h" |
| 14 #include "base/observer_list.h" |
| 14 #include "ui/views/context_menu_controller.h" | 15 #include "ui/views/context_menu_controller.h" |
| 15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 class BoundsAnimator; | 20 class BoundsAnimator; |
| 20 class ImageButton; | 21 class ImageButton; |
| 21 class MenuRunner; | 22 class MenuRunner; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace ash { | 25 namespace ash { |
| 25 | 26 |
| 26 class LauncherDelegate; | 27 class LauncherDelegate; |
| 27 struct LauncherItem; | 28 struct LauncherItem; |
| 29 class LauncherIconsObserver; |
| 28 class LauncherModel; | 30 class LauncherModel; |
| 29 class ViewModel; | 31 class ViewModel; |
| 30 | 32 |
| 31 namespace internal { | 33 namespace internal { |
| 32 | 34 |
| 33 class LauncherButton; | 35 class LauncherButton; |
| 34 | 36 |
| 35 class ASH_EXPORT LauncherView : public views::View, | 37 class ASH_EXPORT LauncherView : public views::View, |
| 36 public LauncherModelObserver, | 38 public LauncherModelObserver, |
| 37 public views::ButtonListener, | 39 public views::ButtonListener, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 | 59 |
| 58 LauncherView(LauncherModel* model, LauncherDelegate* delegate); | 60 LauncherView(LauncherModel* model, LauncherDelegate* delegate); |
| 59 virtual ~LauncherView(); | 61 virtual ~LauncherView(); |
| 60 | 62 |
| 61 void Init(); | 63 void Init(); |
| 62 | 64 |
| 63 // Returns the ideal bounds of the specified item, or an empty rect if id | 65 // Returns the ideal bounds of the specified item, or an empty rect if id |
| 64 // isn't know. | 66 // isn't know. |
| 65 gfx::Rect GetIdealBoundsOfItemIcon(LauncherID id); | 67 gfx::Rect GetIdealBoundsOfItemIcon(LauncherID id); |
| 66 | 68 |
| 69 |
| 70 void AddIconsObserver(LauncherIconsObserver* observer); |
| 71 void RemoveIconsObserver(LauncherIconsObserver* observer); |
| 72 |
| 67 // Returns true if we're showing a menu. | 73 // Returns true if we're showing a menu. |
| 68 bool IsShowingMenu() const; | 74 bool IsShowingMenu() const; |
| 69 | 75 |
| 70 private: | 76 private: |
| 71 class FadeOutAnimationDelegate; | 77 class FadeOutAnimationDelegate; |
| 72 class StartFadeAnimationDelegate; | 78 class StartFadeAnimationDelegate; |
| 73 | 79 |
| 74 struct IdealBounds { | 80 struct IdealBounds { |
| 75 gfx::Rect overflow_bounds; | 81 gfx::Rect overflow_bounds; |
| 76 }; | 82 }; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 187 |
| 182 // Used for the context menu of a particular item. | 188 // Used for the context menu of a particular item. |
| 183 LauncherID context_menu_id_; | 189 LauncherID context_menu_id_; |
| 184 | 190 |
| 185 #if !defined(OS_MACOSX) | 191 #if !defined(OS_MACOSX) |
| 186 scoped_ptr<views::MenuRunner> overflow_menu_runner_; | 192 scoped_ptr<views::MenuRunner> overflow_menu_runner_; |
| 187 | 193 |
| 188 scoped_ptr<views::MenuRunner> launcher_menu_runner_; | 194 scoped_ptr<views::MenuRunner> launcher_menu_runner_; |
| 189 #endif | 195 #endif |
| 190 | 196 |
| 197 ObserverList<LauncherIconsObserver> observers_; |
| 198 |
| 191 DISALLOW_COPY_AND_ASSIGN(LauncherView); | 199 DISALLOW_COPY_AND_ASSIGN(LauncherView); |
| 192 }; | 200 }; |
| 193 | 201 |
| 194 } // namespace internal | 202 } // namespace internal |
| 195 } // namespace ash | 203 } // namespace ash |
| 196 | 204 |
| 197 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 205 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| OLD | NEW |