| 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_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ | 5 #ifndef ASH_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| 6 #define ASH_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ | 6 #define ASH_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/views/bubble/bubble_dialog_delegate.h" | 10 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // views::BubbleDialogDelegateView overrides: | 34 // views::BubbleDialogDelegateView overrides: |
| 35 int GetDialogButtons() const override; | 35 int GetDialogButtons() const override; |
| 36 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, | 36 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, |
| 37 views::Widget* bubble_widget) const override; | 37 views::Widget* bubble_widget) const override; |
| 38 gfx::Rect GetBubbleBounds() override; | 38 gfx::Rect GetBubbleBounds() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 friend class test::OverflowBubbleViewTestAPI; | 41 friend class test::OverflowBubbleViewTestAPI; |
| 42 | 42 |
| 43 bool IsHorizontalAlignment() const; | |
| 44 | |
| 45 const gfx::Size GetContentsSize() const; | 43 const gfx::Size GetContentsSize() const; |
| 46 | 44 |
| 47 // Gets arrow location based on shelf alignment. | 45 // Gets arrow location based on shelf alignment. |
| 48 views::BubbleBorder::Arrow GetBubbleArrow() const; | 46 views::BubbleBorder::Arrow GetBubbleArrow() const; |
| 49 | 47 |
| 50 void ScrollByXOffset(int x_offset); | 48 void ScrollByXOffset(int x_offset); |
| 51 void ScrollByYOffset(int y_offset); | 49 void ScrollByYOffset(int y_offset); |
| 52 | 50 |
| 53 // views::View overrides: | 51 // views::View overrides: |
| 54 gfx::Size GetPreferredSize() const override; | 52 gfx::Size GetPreferredSize() const override; |
| 55 void Layout() override; | 53 void Layout() override; |
| 56 void ChildPreferredSizeChanged(views::View* child) override; | 54 void ChildPreferredSizeChanged(views::View* child) override; |
| 57 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; | 55 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
| 58 | 56 |
| 59 // ui::EventHandler overrides: | 57 // ui::EventHandler overrides: |
| 60 void OnScrollEvent(ui::ScrollEvent* event) override; | 58 void OnScrollEvent(ui::ScrollEvent* event) override; |
| 61 | 59 |
| 62 WmShelf* wm_shelf_; | 60 WmShelf* wm_shelf_; |
| 63 views::View* shelf_view_; // Owned by views hierarchy. | 61 views::View* shelf_view_; // Owned by views hierarchy. |
| 64 gfx::Vector2d scroll_offset_; | 62 gfx::Vector2d scroll_offset_; |
| 65 | 63 |
| 66 DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView); | 64 DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace ash | 67 } // namespace ash |
| 70 | 68 |
| 71 #endif // ASH_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ | 69 #endif // ASH_COMMON_SHELF_OVERFLOW_BUBBLE_VIEW_H_ |
| OLD | NEW |