| 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_LAUNCHER_VIEW_TEST_API_H_ | 5 #ifndef ASH_TEST_LAUNCHER_VIEW_TEST_API_H_ |
| 6 #define ASH_TEST_LAUNCHER_VIEW_TEST_API_H_ | 6 #define ASH_TEST_LAUNCHER_VIEW_TEST_API_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 class Rect; | 11 class Rect; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 | 15 |
| 16 namespace internal { | 16 namespace internal { |
| 17 class AppListButton; |
| 17 class LauncherButton; | 18 class LauncherButton; |
| 18 class LauncherView; | 19 class LauncherView; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace test { | 22 namespace test { |
| 22 | 23 |
| 23 // Use the api in this class to test LauncherView. | 24 // Use the api in this class to test LauncherView. |
| 24 class LauncherViewTestAPI { | 25 class LauncherViewTestAPI { |
| 25 public: | 26 public: |
| 26 explicit LauncherViewTestAPI(internal::LauncherView* launcher_view); | 27 explicit LauncherViewTestAPI(internal::LauncherView* launcher_view); |
| 27 ~LauncherViewTestAPI(); | 28 ~LauncherViewTestAPI(); |
| 28 | 29 |
| 29 // Number of icons displayed. | 30 // Number of icons displayed. |
| 30 int GetButtonCount(); | 31 int GetButtonCount(); |
| 31 | 32 |
| 32 // Retrieve the button at |index|. | 33 // Retrieve the button at |index|. |
| 33 internal::LauncherButton* GetButton(int index); | 34 internal::LauncherButton* GetButton(int index); |
| 34 | 35 |
| 35 // Last visible button index. | 36 // Last visible button index. |
| 36 int GetLastVisibleIndex(); | 37 int GetLastVisibleIndex(); |
| 37 | 38 |
| 38 // Gets current/ideal bounds for button at |index|. | 39 // Gets current/ideal bounds for button at |index|. |
| 39 const gfx::Rect& GetBoundsByIndex(int index); | 40 const gfx::Rect& GetBoundsByIndex(int index); |
| 40 const gfx::Rect& GetIdealBoundsByIndex(int index); | 41 const gfx::Rect& GetIdealBoundsByIndex(int index); |
| 41 | 42 |
| 43 // Gets the app list button. |
| 44 internal::AppListButton* GetAppListButton(); |
| 45 |
| 42 // Returns true if overflow button is visible. | 46 // Returns true if overflow button is visible. |
| 43 bool IsOverflowButtonVisible(); | 47 bool IsOverflowButtonVisible(); |
| 44 | 48 |
| 45 // Makes launcher view show its overflow bubble. | 49 // Makes launcher view show its overflow bubble. |
| 46 void ShowOverflowBubble(); | 50 void ShowOverflowBubble(); |
| 47 | 51 |
| 48 // Sets animation duration in milliseconds for test. | 52 // Sets animation duration in milliseconds for test. |
| 49 void SetAnimationDuration(int duration_ms); | 53 void SetAnimationDuration(int duration_ms); |
| 50 | 54 |
| 51 // Runs message loop and waits until all add/remove animations are done. | 55 // Runs message loop and waits until all add/remove animations are done. |
| 52 void RunMessageLoopUntilAnimationsDone(); | 56 void RunMessageLoopUntilAnimationsDone(); |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 internal::LauncherView* launcher_view_; | 59 internal::LauncherView* launcher_view_; |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(LauncherViewTestAPI); | 61 DISALLOW_COPY_AND_ASSIGN(LauncherViewTestAPI); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 } // namespace test | 64 } // namespace test |
| 61 } // namespace ash | 65 } // namespace ash |
| 62 | 66 |
| 63 #endif // ASH_TEST_LAUNCHER_VIEW_TEST_API_H_ | 67 #endif // ASH_TEST_LAUNCHER_VIEW_TEST_API_H_ |
| OLD | NEW |