| 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_; } | 21 int activate_count() { return activate_count_; } |
| 22 int dismiss_count() { return dismiss_count_; } | 22 int dismiss_count() { return dismiss_count_; } |
| 23 AppListItemModel* last_activated() { return last_activated_; } | 23 AppListItemModel* last_activated() { return last_activated_; } |
| 24 void set_test_signin_delegate(SigninDelegate* signin_delegate) { | 24 void set_test_signin_delegate(SigninDelegate* signin_delegate) { |
| 25 test_signin_delegate_ = signin_delegate; | 25 test_signin_delegate_ = signin_delegate; |
| 26 } | 26 } |
| 27 | 27 |
| 28 // AppListViewDelegate overrides: | 28 // AppListViewDelegate overrides: |
| 29 virtual void SetModel(AppListModel* model) OVERRIDE {} | 29 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} |
| 30 virtual void InitModel(AppListModel* model) OVERRIDE {} |
| 30 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 31 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
| 31 virtual void GetShortcutPathForApp( | 32 virtual void GetShortcutPathForApp( |
| 32 const std::string& app_id, | 33 const std::string& app_id, |
| 33 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 34 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
| 34 virtual void ActivateAppListItem(AppListItemModel* item, | 35 virtual void ActivateAppListItem(AppListItemModel* item, |
| 35 int event_flags) OVERRIDE; | 36 int event_flags) OVERRIDE; |
| 36 virtual void StartSearch() OVERRIDE {} | 37 virtual void StartSearch() OVERRIDE {} |
| 37 virtual void StopSearch() OVERRIDE {} | 38 virtual void StopSearch() OVERRIDE {} |
| 38 virtual void OpenSearchResult(SearchResult* result, | 39 virtual void OpenSearchResult(SearchResult* result, |
| 39 int event_flags) OVERRIDE {} | 40 int event_flags) OVERRIDE {} |
| 40 virtual void InvokeSearchResultAction(SearchResult* result, | 41 virtual void InvokeSearchResultAction(SearchResult* result, |
| 41 int action_index, | 42 int action_index, |
| 42 int event_flags) OVERRIDE {} | 43 int event_flags) OVERRIDE {} |
| 43 virtual void Dismiss() OVERRIDE; | 44 virtual void Dismiss() OVERRIDE; |
| 44 virtual void ViewClosing() OVERRIDE {} | 45 virtual void ViewClosing() OVERRIDE {} |
| 45 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 46 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
| 46 virtual void OpenSettings() OVERRIDE {} | 47 virtual void OpenSettings() OVERRIDE {} |
| 47 virtual void OpenHelp() OVERRIDE {} | 48 virtual void OpenHelp() OVERRIDE {} |
| 48 virtual void OpenFeedback() OVERRIDE {} | 49 virtual void OpenFeedback() OVERRIDE {} |
| 50 virtual void ShowForProfileByPath( |
| 51 const base::FilePath& profile_path) OVERRIDE {} |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 int activate_count_; | 54 int activate_count_; |
| 52 int dismiss_count_; | 55 int dismiss_count_; |
| 53 AppListItemModel* last_activated_; | 56 AppListItemModel* last_activated_; |
| 54 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. | 57 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace test | 60 } // namespace test |
| 58 } // namespace app_list | 61 } // namespace app_list |
| 59 | 62 |
| 60 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 63 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| OLD | NEW |