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> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/observer_list.h" | |
19 #include "ui/app_list/app_list_view_delegate.h" | 18 #include "ui/app_list/app_list_view_delegate.h" |
20 #include "ui/app_list/speech_ui_model.h" | 19 #include "ui/app_list/speech_ui_model.h" |
21 | 20 |
22 namespace app_list { | 21 namespace app_list { |
23 namespace test { | 22 namespace test { |
24 | 23 |
25 class AppListTestModel; | 24 class AppListTestModel; |
26 | 25 |
27 // A concrete AppListViewDelegate for unit tests. | 26 // A concrete AppListViewDelegate for unit tests. |
28 class AppListTestViewDelegate : public AppListViewDelegate { | 27 class AppListTestViewDelegate : public AppListViewDelegate { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void ShowForProfileByPath(const base::FilePath& profile_path) override {} | 75 void ShowForProfileByPath(const base::FilePath& profile_path) override {} |
77 #if defined(TOOLKIT_VIEWS) | 76 #if defined(TOOLKIT_VIEWS) |
78 views::View* CreateStartPageWebView(const gfx::Size& size) override; | 77 views::View* CreateStartPageWebView(const gfx::Size& size) override; |
79 std::vector<views::View*> CreateCustomPageWebViews( | 78 std::vector<views::View*> CreateCustomPageWebViews( |
80 const gfx::Size& size) override; | 79 const gfx::Size& size) override; |
81 void CustomLauncherPageAnimationChanged(double progress) override {} | 80 void CustomLauncherPageAnimationChanged(double progress) override {} |
82 void CustomLauncherPagePopSubpage() override {} | 81 void CustomLauncherPagePopSubpage() override {} |
83 #endif | 82 #endif |
84 bool IsSpeechRecognitionEnabled() override; | 83 bool IsSpeechRecognitionEnabled() override; |
85 const Users& GetUsers() const override; | 84 const Users& GetUsers() const override; |
86 void AddObserver(AppListViewDelegateObserver* observer) override; | |
87 void RemoveObserver(AppListViewDelegateObserver* observer) override; | |
88 | 85 |
89 // Do a bulk replacement of the items in the model. | 86 // Do a bulk replacement of the items in the model. |
90 void ReplaceTestModel(int item_count); | 87 void ReplaceTestModel(int item_count); |
91 | 88 |
92 AppListTestModel* ReleaseTestModel() { return model_.release(); } | 89 AppListTestModel* ReleaseTestModel() { return model_.release(); } |
93 AppListTestModel* GetTestModel() { return model_.get(); } | 90 AppListTestModel* GetTestModel() { return model_.get(); } |
94 | 91 |
95 private: | 92 private: |
96 int dismiss_count_; | 93 int dismiss_count_; |
97 int stop_speech_recognition_count_; | 94 int stop_speech_recognition_count_; |
98 int open_search_result_count_; | 95 int open_search_result_count_; |
99 int next_profile_app_count_; | 96 int next_profile_app_count_; |
100 std::map<size_t, int> open_search_result_counts_; | 97 std::map<size_t, int> open_search_result_counts_; |
101 Users users_; | 98 Users users_; |
102 std::unique_ptr<AppListTestModel> model_; | 99 std::unique_ptr<AppListTestModel> model_; |
103 base::ObserverList<AppListViewDelegateObserver> observers_; | |
104 SpeechUIModel speech_ui_; | 100 SpeechUIModel speech_ui_; |
105 base::TimeDelta auto_launch_timeout_; | 101 base::TimeDelta auto_launch_timeout_; |
106 | 102 |
107 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); | 103 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); |
108 }; | 104 }; |
109 | 105 |
110 } // namespace test | 106 } // namespace test |
111 } // namespace app_list | 107 } // namespace app_list |
112 | 108 |
113 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 109 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
OLD | NEW |