| 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 UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 5 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
| 11 | 11 |
| 12 namespace app_list { | 12 namespace app_list { |
| 13 namespace test { | 13 namespace test { |
| 14 | 14 |
| 15 // A concrete AppListViewDelegate for unit tests. | 15 // A concrete AppListViewDelegate for unit tests. |
| 16 class AppListTestViewDelegate : public AppListViewDelegate { | 16 class AppListTestViewDelegate : public AppListViewDelegate { |
| 17 public: | 17 public: |
| 18 AppListTestViewDelegate(); | 18 AppListTestViewDelegate(); |
| 19 virtual ~AppListTestViewDelegate(); | 19 virtual ~AppListTestViewDelegate(); |
| 20 | 20 |
| 21 int activate_count() { return activate_count_; } | |
| 22 int dismiss_count() { return dismiss_count_; } | 21 int dismiss_count() { return dismiss_count_; } |
| 23 AppListItemModel* last_activated() { return last_activated_; } | |
| 24 void set_test_signin_delegate(SigninDelegate* signin_delegate) { | 22 void set_test_signin_delegate(SigninDelegate* signin_delegate) { |
| 25 test_signin_delegate_ = signin_delegate; | 23 test_signin_delegate_ = signin_delegate; |
| 26 } | 24 } |
| 27 | 25 |
| 28 // AppListViewDelegate overrides: | 26 // AppListViewDelegate overrides: |
| 29 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} | 27 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} |
| 30 virtual void InitModel(AppListModel* model) OVERRIDE {} | 28 virtual void InitModel(AppListModel* model) OVERRIDE {} |
| 31 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 29 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
| 32 virtual void GetShortcutPathForApp( | 30 virtual void GetShortcutPathForApp( |
| 33 const std::string& app_id, | 31 const std::string& app_id, |
| 34 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 32 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
| 35 virtual void ActivateAppListItem(AppListItemModel* item, | |
| 36 int event_flags) OVERRIDE; | |
| 37 virtual void StartSearch() OVERRIDE {} | 33 virtual void StartSearch() OVERRIDE {} |
| 38 virtual void StopSearch() OVERRIDE {} | 34 virtual void StopSearch() OVERRIDE {} |
| 39 virtual void OpenSearchResult(SearchResult* result, | 35 virtual void OpenSearchResult(SearchResult* result, |
| 40 int event_flags) OVERRIDE {} | 36 int event_flags) OVERRIDE {} |
| 41 virtual void InvokeSearchResultAction(SearchResult* result, | 37 virtual void InvokeSearchResultAction(SearchResult* result, |
| 42 int action_index, | 38 int action_index, |
| 43 int event_flags) OVERRIDE {} | 39 int event_flags) OVERRIDE {} |
| 44 virtual void Dismiss() OVERRIDE; | 40 virtual void Dismiss() OVERRIDE; |
| 45 virtual void ViewClosing() OVERRIDE {} | 41 virtual void ViewClosing() OVERRIDE {} |
| 46 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 42 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
| 47 virtual void OpenSettings() OVERRIDE {} | 43 virtual void OpenSettings() OVERRIDE {} |
| 48 virtual void OpenHelp() OVERRIDE {} | 44 virtual void OpenHelp() OVERRIDE {} |
| 49 virtual void OpenFeedback() OVERRIDE {} | 45 virtual void OpenFeedback() OVERRIDE {} |
| 50 virtual void ShowForProfileByPath( | 46 virtual void ShowForProfileByPath( |
| 51 const base::FilePath& profile_path) OVERRIDE {}; | 47 const base::FilePath& profile_path) OVERRIDE {}; |
| 52 | 48 |
| 53 private: | 49 private: |
| 54 int activate_count_; | |
| 55 int dismiss_count_; | 50 int dismiss_count_; |
| 56 AppListItemModel* last_activated_; | |
| 57 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. | 51 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. |
| 58 }; | 52 }; |
| 59 | 53 |
| 60 } // namespace test | 54 } // namespace test |
| 61 } // namespace app_list | 55 } // namespace app_list |
| 62 | 56 |
| 63 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 57 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| OLD | NEW |