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 "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "ui/app_list/app_list_view_delegate.h" | 14 #include "ui/app_list/app_list_view_delegate.h" |
| 15 #include "ui/app_list/speech_ui_model.h" |
15 | 16 |
16 namespace app_list { | 17 namespace app_list { |
17 namespace test { | 18 namespace test { |
18 | 19 |
19 class AppListTestModel; | 20 class AppListTestModel; |
20 class TestSigninDelegate; | 21 class TestSigninDelegate; |
21 | 22 |
22 // A concrete AppListViewDelegate for unit tests. | 23 // A concrete AppListViewDelegate for unit tests. |
23 class AppListTestViewDelegate : public AppListViewDelegate { | 24 class AppListTestViewDelegate : public AppListViewDelegate { |
24 public: | 25 public: |
25 AppListTestViewDelegate(); | 26 AppListTestViewDelegate(); |
26 virtual ~AppListTestViewDelegate(); | 27 virtual ~AppListTestViewDelegate(); |
27 | 28 |
28 int dismiss_count() { return dismiss_count_; } | 29 int dismiss_count() { return dismiss_count_; } |
29 int open_search_result_count() { return open_search_result_count_; } | 30 int open_search_result_count() { return open_search_result_count_; } |
30 void SetUsers(const Users& users) { | 31 void SetUsers(const Users& users) { |
31 users_ = users; | 32 users_ = users; |
32 } | 33 } |
33 | 34 |
34 // Sets the signin status of the signin delegate, creating one if there isn't | 35 // Sets the signin status of the signin delegate, creating one if there isn't |
35 // one already. | 36 // one already. |
36 void SetSignedIn(bool signed_in); | 37 void SetSignedIn(bool signed_in); |
37 | 38 |
38 // AppListViewDelegate overrides: | 39 // AppListViewDelegate overrides: |
39 virtual bool ForceNativeDesktop() const OVERRIDE; | 40 virtual bool ForceNativeDesktop() const OVERRIDE; |
40 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} | 41 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} |
41 virtual AppListModel* GetModel() OVERRIDE; | 42 virtual AppListModel* GetModel() OVERRIDE; |
42 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 43 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
| 44 virtual SpeechUIModel* GetSpeechUI() OVERRIDE; |
43 virtual void GetShortcutPathForApp( | 45 virtual void GetShortcutPathForApp( |
44 const std::string& app_id, | 46 const std::string& app_id, |
45 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 47 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
46 virtual void StartSearch() OVERRIDE {} | 48 virtual void StartSearch() OVERRIDE {} |
47 virtual void StopSearch() OVERRIDE {} | 49 virtual void StopSearch() OVERRIDE {} |
48 virtual void OpenSearchResult(SearchResult* result, | 50 virtual void OpenSearchResult(SearchResult* result, |
49 int event_flags) OVERRIDE; | 51 int event_flags) OVERRIDE; |
50 virtual void InvokeSearchResultAction(SearchResult* result, | 52 virtual void InvokeSearchResultAction(SearchResult* result, |
51 int action_index, | 53 int action_index, |
52 int event_flags) OVERRIDE {} | 54 int event_flags) OVERRIDE {} |
(...skipping 18 matching lines...) Expand all Loading... |
71 | 73 |
72 AppListTestModel* GetTestModel() { return model_.get(); } | 74 AppListTestModel* GetTestModel() { return model_.get(); } |
73 | 75 |
74 private: | 76 private: |
75 int dismiss_count_; | 77 int dismiss_count_; |
76 int open_search_result_count_; | 78 int open_search_result_count_; |
77 Users users_; | 79 Users users_; |
78 scoped_ptr<TestSigninDelegate> test_signin_delegate_; | 80 scoped_ptr<TestSigninDelegate> test_signin_delegate_; |
79 scoped_ptr<AppListTestModel> model_; | 81 scoped_ptr<AppListTestModel> model_; |
80 ObserverList<app_list::AppListViewDelegateObserver> observers_; | 82 ObserverList<app_list::AppListViewDelegateObserver> observers_; |
| 83 SpeechUIModel speech_ui_; |
81 }; | 84 }; |
82 | 85 |
83 } // namespace test | 86 } // namespace test |
84 } // namespace app_list | 87 } // namespace app_list |
85 | 88 |
86 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 89 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
OLD | NEW |