| 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_OVERFLOW_BUBBLE_VIEW_H_ | 5 #ifndef ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| 6 #define ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_ | 6 #define ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/shelf/shelf_background_animator.h" | 9 #include "ash/shelf/shelf_background_animator.h" |
| 10 #include "ash/shelf/shelf_background_animator_observer.h" | 10 #include "ash/shelf/shelf_background_animator_observer.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/views/bubble/bubble_dialog_delegate.h" | 12 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class View; | 15 class View; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 class WmShelf; | 19 class Shelf; |
| 20 | 20 |
| 21 namespace test { | 21 namespace test { |
| 22 class OverflowBubbleViewTestAPI; | 22 class OverflowBubbleViewTestAPI; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // OverflowBubbleView hosts a ShelfView to display overflown items. | 25 // OverflowBubbleView hosts a ShelfView to display overflown items. |
| 26 // Exports to access this class from OverflowBubbleViewTestAPI. | 26 // Exports to access this class from OverflowBubbleViewTestAPI. |
| 27 class ASH_EXPORT OverflowBubbleView : public views::BubbleDialogDelegateView, | 27 class ASH_EXPORT OverflowBubbleView : public views::BubbleDialogDelegateView, |
| 28 public ShelfBackgroundAnimatorObserver { | 28 public ShelfBackgroundAnimatorObserver { |
| 29 public: | 29 public: |
| 30 explicit OverflowBubbleView(WmShelf* wm_shelf); | 30 explicit OverflowBubbleView(Shelf* shelf); |
| 31 ~OverflowBubbleView() override; | 31 ~OverflowBubbleView() override; |
| 32 | 32 |
| 33 // |anchor| is the overflow button on the main shelf. |shelf_view| is the | 33 // |anchor| is the overflow button on the main shelf. |shelf_view| is the |
| 34 // ShelfView containing the overflow items. | 34 // ShelfView containing the overflow items. |
| 35 void InitOverflowBubble(views::View* anchor, views::View* shelf_view); | 35 void InitOverflowBubble(views::View* anchor, views::View* shelf_view); |
| 36 | 36 |
| 37 // views::BubbleDialogDelegateView overrides: | 37 // views::BubbleDialogDelegateView overrides: |
| 38 int GetDialogButtons() const override; | 38 int GetDialogButtons() const override; |
| 39 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, | 39 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, |
| 40 views::Widget* bubble_widget) const override; | 40 views::Widget* bubble_widget) const override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 51 void Layout() override; | 51 void Layout() override; |
| 52 void ChildPreferredSizeChanged(views::View* child) override; | 52 void ChildPreferredSizeChanged(views::View* child) override; |
| 53 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; | 53 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
| 54 | 54 |
| 55 // ui::EventHandler overrides: | 55 // ui::EventHandler overrides: |
| 56 void OnScrollEvent(ui::ScrollEvent* event) override; | 56 void OnScrollEvent(ui::ScrollEvent* event) override; |
| 57 | 57 |
| 58 // ShelfBackgroundAnimatorObserver: | 58 // ShelfBackgroundAnimatorObserver: |
| 59 void UpdateShelfBackground(SkColor color) override; | 59 void UpdateShelfBackground(SkColor color) override; |
| 60 | 60 |
| 61 WmShelf* wm_shelf_; | 61 Shelf* shelf_; |
| 62 views::View* shelf_view_; // Owned by views hierarchy. | 62 views::View* shelf_view_; // Owned by views hierarchy. |
| 63 gfx::Vector2d scroll_offset_; | 63 gfx::Vector2d scroll_offset_; |
| 64 | 64 |
| 65 ShelfBackgroundAnimator background_animator_; | 65 ShelfBackgroundAnimator background_animator_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView); | 67 DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace ash | 70 } // namespace ash |
| 71 | 71 |
| 72 #endif // ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_ | 72 #endif // ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| OLD | NEW |