usb_gadget: Switch to official Google product IDs.
[chromium-blink-merge.git] / ash / shelf / overflow_bubble_view.h
blob4348a2d4c860c8665a95c25167beaea9b905d348
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
3 // found in the LICENSE file.
5 #ifndef ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_
6 #define ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "ui/views/bubble/bubble_delegate.h"
13 namespace ash {
14 class ShelfLayoutManager;
15 class ShelfView;
17 namespace test {
18 class OverflowBubbleViewTestAPI;
21 // OverflowBubbleView hosts a ShelfView to display overflown items.
22 // Exports to access this class from OverflowBubbleViewTestAPI.
23 class ASH_EXPORT OverflowBubbleView : public views::BubbleDelegateView {
24 public:
25 OverflowBubbleView();
26 virtual ~OverflowBubbleView();
28 void InitOverflowBubble(views::View* anchor, ShelfView* shelf_view);
30 // views::BubbleDelegateView overrides:
31 virtual gfx::Rect GetBubbleBounds() OVERRIDE;
33 private:
34 friend class test::OverflowBubbleViewTestAPI;
36 bool IsHorizontalAlignment() const;
38 const gfx::Size GetContentsSize() const;
40 // Gets arrow location based on shelf alignment.
41 views::BubbleBorder::Arrow GetBubbleArrow() const;
43 void ScrollByXOffset(int x_offset);
44 void ScrollByYOffset(int y_offset);
46 // views::View overrides:
47 virtual gfx::Size GetPreferredSize() const OVERRIDE;
48 virtual void Layout() OVERRIDE;
49 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
50 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
52 // ui::EventHandler overrides:
53 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
55 ShelfLayoutManager* GetShelfLayoutManager() const;
57 ShelfView* shelf_view_; // Owned by views hierarchy.
58 gfx::Vector2d scroll_offset_;
60 DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView);
63 } // namespace ash
65 #endif // ASH_SHELF_OVERFLOW_BUBBLE_VIEW_H_