| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class AppListTestModel; | 24 class AppListTestModel; |
| 25 | 25 |
| 26 // A concrete AppListViewDelegate for unit tests. | 26 // A concrete AppListViewDelegate for unit tests. |
| 27 class AppListTestViewDelegate : public AppListViewDelegate { | 27 class AppListTestViewDelegate : public AppListViewDelegate { |
| 28 public: | 28 public: |
| 29 AppListTestViewDelegate(); | 29 AppListTestViewDelegate(); |
| 30 ~AppListTestViewDelegate() override; | 30 ~AppListTestViewDelegate() override; |
| 31 | 31 |
| 32 int dismiss_count() { return dismiss_count_; } | 32 int dismiss_count() { return dismiss_count_; } |
| 33 int open_search_result_count() { return open_search_result_count_; } | 33 int open_search_result_count() { return open_search_result_count_; } |
| 34 void SetUsers(const Users& users) { | |
| 35 users_ = users; | |
| 36 } | |
| 37 std::map<size_t, int> open_search_result_counts() { | 34 std::map<size_t, int> open_search_result_counts() { |
| 38 return open_search_result_counts_; | 35 return open_search_result_counts_; |
| 39 } | 36 } |
| 40 | 37 |
| 41 // Sets the number of apps that the model will be created with the next time | 38 // Sets the number of apps that the model will be created with the next time |
| 42 // SetProfileByPath() is called. | 39 // SetProfileByPath() is called. |
| 43 void set_next_profile_app_count(int apps) { next_profile_app_count_ = apps; } | 40 void set_next_profile_app_count(int apps) { next_profile_app_count_ = apps; } |
| 44 | 41 |
| 45 void set_auto_launch_timeout(const base::TimeDelta& timeout) { | 42 void set_auto_launch_timeout(const base::TimeDelta& timeout) { |
| 46 auto_launch_timeout_ = timeout; | 43 auto_launch_timeout_ = timeout; |
| 47 } | 44 } |
| 48 | 45 |
| 49 // Returns the value of |stop_speech_recognition_count_| and then resets this | 46 // Returns the value of |stop_speech_recognition_count_| and then resets this |
| 50 // value to 0. | 47 // value to 0. |
| 51 int GetStopSpeechRecognitionCountAndReset(); | 48 int GetStopSpeechRecognitionCountAndReset(); |
| 52 | 49 |
| 53 // AppListViewDelegate overrides: | 50 // AppListViewDelegate overrides: |
| 54 bool ForceNativeDesktop() const override; | |
| 55 void SetProfileByPath(const base::FilePath& profile_path) override; | |
| 56 AppListModel* GetModel() override; | 51 AppListModel* GetModel() override; |
| 57 SpeechUIModel* GetSpeechUI() override; | 52 SpeechUIModel* GetSpeechUI() override; |
| 58 void StartSearch() override {} | 53 void StartSearch() override {} |
| 59 void StopSearch() override {} | 54 void StopSearch() override {} |
| 60 void OpenSearchResult(SearchResult* result, | 55 void OpenSearchResult(SearchResult* result, |
| 61 bool auto_launch, | 56 bool auto_launch, |
| 62 int event_flags) override; | 57 int event_flags) override; |
| 63 void InvokeSearchResultAction(SearchResult* result, | 58 void InvokeSearchResultAction(SearchResult* result, |
| 64 int action_index, | 59 int action_index, |
| 65 int event_flags) override {} | 60 int event_flags) override {} |
| 66 base::TimeDelta GetAutoLaunchTimeout() override; | 61 base::TimeDelta GetAutoLaunchTimeout() override; |
| 67 void AutoLaunchCanceled() override; | 62 void AutoLaunchCanceled() override; |
| 68 void ViewInitialized() override {} | 63 void ViewInitialized() override {} |
| 69 void Dismiss() override; | 64 void Dismiss() override; |
| 70 void ViewClosing() override {} | 65 void ViewClosing() override {} |
| 71 void OpenHelp() override {} | |
| 72 void OpenFeedback() override {} | |
| 73 void StartSpeechRecognition() override {} | 66 void StartSpeechRecognition() override {} |
| 74 void StopSpeechRecognition() override; | 67 void StopSpeechRecognition() override; |
| 75 void ShowForProfileByPath(const base::FilePath& profile_path) override {} | |
| 76 #if defined(TOOLKIT_VIEWS) | |
| 77 views::View* CreateStartPageWebView(const gfx::Size& size) override; | 68 views::View* CreateStartPageWebView(const gfx::Size& size) override; |
| 78 std::vector<views::View*> CreateCustomPageWebViews( | 69 std::vector<views::View*> CreateCustomPageWebViews( |
| 79 const gfx::Size& size) override; | 70 const gfx::Size& size) override; |
| 80 void CustomLauncherPageAnimationChanged(double progress) override {} | 71 void CustomLauncherPageAnimationChanged(double progress) override {} |
| 81 void CustomLauncherPagePopSubpage() override {} | 72 void CustomLauncherPagePopSubpage() override {} |
| 82 #endif | |
| 83 bool IsSpeechRecognitionEnabled() override; | 73 bool IsSpeechRecognitionEnabled() override; |
| 84 const Users& GetUsers() const override; | |
| 85 | 74 |
| 86 // Do a bulk replacement of the items in the model. | 75 // Do a bulk replacement of the items in the model. |
| 87 void ReplaceTestModel(int item_count); | 76 void ReplaceTestModel(int item_count); |
| 88 | 77 |
| 89 AppListTestModel* ReleaseTestModel() { return model_.release(); } | 78 AppListTestModel* ReleaseTestModel() { return model_.release(); } |
| 90 AppListTestModel* GetTestModel() { return model_.get(); } | 79 AppListTestModel* GetTestModel() { return model_.get(); } |
| 91 | 80 |
| 92 private: | 81 private: |
| 93 int dismiss_count_; | 82 int dismiss_count_; |
| 94 int stop_speech_recognition_count_; | 83 int stop_speech_recognition_count_; |
| 95 int open_search_result_count_; | 84 int open_search_result_count_; |
| 96 int next_profile_app_count_; | 85 int next_profile_app_count_; |
| 97 std::map<size_t, int> open_search_result_counts_; | 86 std::map<size_t, int> open_search_result_counts_; |
| 98 Users users_; | |
| 99 std::unique_ptr<AppListTestModel> model_; | 87 std::unique_ptr<AppListTestModel> model_; |
| 100 SpeechUIModel speech_ui_; | 88 SpeechUIModel speech_ui_; |
| 101 base::TimeDelta auto_launch_timeout_; | 89 base::TimeDelta auto_launch_timeout_; |
| 102 | 90 |
| 103 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); | 91 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); |
| 104 }; | 92 }; |
| 105 | 93 |
| 106 } // namespace test | 94 } // namespace test |
| 107 } // namespace app_list | 95 } // namespace app_list |
| 108 | 96 |
| 109 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 97 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| OLD | NEW |