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_TEST_SHELF_VIEW_TEST_API_H_ | 5 #ifndef ASH_TEST_SHELF_VIEW_TEST_API_H_ |
6 #define ASH_TEST_SHELF_VIEW_TEST_API_H_ | 6 #define ASH_TEST_SHELF_VIEW_TEST_API_H_ |
7 | 7 |
8 #include "ash/shelf/shelf_item_types.h" | 8 #include "ash/shelf/shelf_item_types.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Rect; | 12 class Rect; |
13 class Size; | 13 class Size; |
14 } | 14 } |
15 | 15 |
| 16 namespace ui { |
| 17 class Event; |
| 18 } |
| 19 |
| 20 namespace views { |
| 21 class Button; |
| 22 } |
| 23 |
16 namespace ash { | 24 namespace ash { |
17 class OverflowBubble; | 25 class OverflowBubble; |
18 class ShelfButton; | 26 class ShelfButton; |
19 class ShelfDelegate; | 27 class ShelfDelegate; |
20 class ShelfView; | 28 class ShelfView; |
21 | 29 |
22 namespace test { | 30 namespace test { |
23 | 31 |
24 // Use the api in this class to test ShelfView. | 32 // Use the api in this class to test ShelfView. |
25 class ShelfViewTestAPI { | 33 class ShelfViewTestAPI { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 71 |
64 // Returns the preferred size of |shelf_view_|. | 72 // Returns the preferred size of |shelf_view_|. |
65 gfx::Size GetPreferredSize(); | 73 gfx::Size GetPreferredSize(); |
66 | 74 |
67 // Returns the button size. | 75 // Returns the button size. |
68 int GetButtonSize(); | 76 int GetButtonSize(); |
69 | 77 |
70 // Returns the button space size. | 78 // Returns the button space size. |
71 int GetButtonSpacing(); | 79 int GetButtonSpacing(); |
72 | 80 |
| 81 // Wrapper for ShelfView::ButtonPressed. |
| 82 void ButtonPressed(views::Button* sender, const ui::Event& event); |
| 83 |
73 // Wrapper for ShelfView::SameDragType. | 84 // Wrapper for ShelfView::SameDragType. |
74 bool SameDragType(ShelfItemType typea, ShelfItemType typeb) const; | 85 bool SameDragType(ShelfItemType typea, ShelfItemType typeb) const; |
75 | 86 |
76 // Sets ShelfDelegate. | 87 // Sets ShelfDelegate. |
77 void SetShelfDelegate(ShelfDelegate* delegate); | 88 void SetShelfDelegate(ShelfDelegate* delegate); |
78 | 89 |
79 // Returns re-insertable bounds in screen. | 90 // Returns re-insertable bounds in screen. |
80 gfx::Rect GetBoundsForDragInsertInScreen(); | 91 gfx::Rect GetBoundsForDragInsertInScreen(); |
81 | 92 |
82 // Returns true if item is ripped off. | 93 // Returns true if item is ripped off. |
83 bool IsRippedOffFromShelf(); | 94 bool IsRippedOffFromShelf(); |
84 | 95 |
85 // Returns true if an item is ripped off and entered into shelf. | 96 // Returns true if an item is ripped off and entered into shelf. |
86 bool DraggedItemFromOverflowToShelf(); | 97 bool DraggedItemFromOverflowToShelf(); |
87 | 98 |
88 private: | 99 private: |
89 ShelfView* shelf_view_; | 100 ShelfView* shelf_view_; |
90 | 101 |
91 DISALLOW_COPY_AND_ASSIGN(ShelfViewTestAPI); | 102 DISALLOW_COPY_AND_ASSIGN(ShelfViewTestAPI); |
92 }; | 103 }; |
93 | 104 |
94 } // namespace test | 105 } // namespace test |
95 } // namespace ash | 106 } // namespace ash |
96 | 107 |
97 #endif // ASH_TEST_SHELF_VIEW_TEST_API_H_ | 108 #endif // ASH_TEST_SHELF_VIEW_TEST_API_H_ |
OLD | NEW |