| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "ui/app_list/app_list_view_delegate.h" | 13 #include "ui/app_list/app_list_view_delegate.h" |
| 14 #include "ui/app_list/speech_ui_model.h" |
| 14 | 15 |
| 15 namespace app_list { | 16 namespace app_list { |
| 16 namespace test { | 17 namespace test { |
| 17 | 18 |
| 18 class AppListTestModel; | 19 class AppListTestModel; |
| 19 | 20 |
| 20 // A concrete AppListViewDelegate for unit tests. | 21 // A concrete AppListViewDelegate for unit tests. |
| 21 class AppListTestViewDelegate : public AppListViewDelegate { | 22 class AppListTestViewDelegate : public AppListViewDelegate { |
| 22 public: | 23 public: |
| 23 AppListTestViewDelegate(); | 24 AppListTestViewDelegate(); |
| 24 virtual ~AppListTestViewDelegate(); | 25 virtual ~AppListTestViewDelegate(); |
| 25 | 26 |
| 26 int dismiss_count() { return dismiss_count_; } | 27 int dismiss_count() { return dismiss_count_; } |
| 27 int open_search_result_count() { return open_search_result_count_; } | 28 int open_search_result_count() { return open_search_result_count_; } |
| 28 void set_test_signin_delegate(SigninDelegate* signin_delegate) { | 29 void set_test_signin_delegate(SigninDelegate* signin_delegate) { |
| 29 test_signin_delegate_ = signin_delegate; | 30 test_signin_delegate_ = signin_delegate; |
| 30 } | 31 } |
| 31 | 32 |
| 32 void SetUsers(const Users& users) { | 33 void SetUsers(const Users& users) { |
| 33 users_ = users; | 34 users_ = users; |
| 34 } | 35 } |
| 35 | 36 |
| 36 // AppListViewDelegate overrides: | 37 // AppListViewDelegate overrides: |
| 37 virtual bool ForceNativeDesktop() const OVERRIDE; | 38 virtual bool ForceNativeDesktop() const OVERRIDE; |
| 38 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} | 39 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} |
| 39 virtual AppListModel* GetModel() OVERRIDE; | 40 virtual AppListModel* GetModel() OVERRIDE; |
| 40 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 41 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
| 42 virtual SpeechUIModel* GetSpeechUI() OVERRIDE; |
| 41 virtual void GetShortcutPathForApp( | 43 virtual void GetShortcutPathForApp( |
| 42 const std::string& app_id, | 44 const std::string& app_id, |
| 43 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 45 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
| 44 virtual void StartSearch() OVERRIDE {} | 46 virtual void StartSearch() OVERRIDE {} |
| 45 virtual void StopSearch() OVERRIDE {} | 47 virtual void StopSearch() OVERRIDE {} |
| 46 virtual void OpenSearchResult(SearchResult* result, | 48 virtual void OpenSearchResult(SearchResult* result, |
| 47 int event_flags) OVERRIDE; | 49 int event_flags) OVERRIDE; |
| 48 virtual void InvokeSearchResultAction(SearchResult* result, | 50 virtual void InvokeSearchResultAction(SearchResult* result, |
| 49 int action_index, | 51 int action_index, |
| 50 int event_flags) OVERRIDE {} | 52 int event_flags) OVERRIDE {} |
| (...skipping 13 matching lines...) Expand all Loading... |
| 64 void ReplaceTestModel(int item_count); | 66 void ReplaceTestModel(int item_count); |
| 65 | 67 |
| 66 AppListTestModel* GetTestModel() { return model_.get(); } | 68 AppListTestModel* GetTestModel() { return model_.get(); } |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 int dismiss_count_; | 71 int dismiss_count_; |
| 70 int open_search_result_count_; | 72 int open_search_result_count_; |
| 71 Users users_; | 73 Users users_; |
| 72 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. | 74 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. |
| 73 scoped_ptr<AppListTestModel> model_; | 75 scoped_ptr<AppListTestModel> model_; |
| 76 SpeechUIModel speech_ui_; |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace test | 79 } // namespace test |
| 77 } // namespace app_list | 80 } // namespace app_list |
| 78 | 81 |
| 79 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 82 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| OLD | NEW |