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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 int dismiss_count() { return dismiss_count_; } | 30 int dismiss_count() { return dismiss_count_; } |
31 int open_search_result_count() { return open_search_result_count_; } | 31 int open_search_result_count() { return open_search_result_count_; } |
32 void SetUsers(const Users& users) { | 32 void SetUsers(const Users& users) { |
33 users_ = users; | 33 users_ = users; |
34 } | 34 } |
35 std::map<size_t, int> open_search_result_counts() { | 35 std::map<size_t, int> open_search_result_counts() { |
36 return open_search_result_counts_; | 36 return open_search_result_counts_; |
37 } | 37 } |
38 | 38 |
| 39 // Sets the number of apps that the model will be created with the next time |
| 40 // SetProfileByPath() is called. |
| 41 void set_next_profile_app_count(int apps) { next_profile_app_count_ = apps; } |
| 42 |
39 void set_auto_launch_timeout(const base::TimeDelta& timeout) { | 43 void set_auto_launch_timeout(const base::TimeDelta& timeout) { |
40 auto_launch_timeout_ = timeout; | 44 auto_launch_timeout_ = timeout; |
41 } | 45 } |
42 | 46 |
43 // Sets the signin status of the signin delegate, creating one if there isn't | 47 // Sets the signin status of the signin delegate, creating one if there isn't |
44 // one already. | 48 // one already. |
45 void SetSignedIn(bool signed_in); | 49 void SetSignedIn(bool signed_in); |
46 | 50 |
47 // AppListViewDelegate overrides: | 51 // AppListViewDelegate overrides: |
48 virtual bool ForceNativeDesktop() const OVERRIDE; | 52 virtual bool ForceNativeDesktop() const OVERRIDE; |
49 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} | 53 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; |
50 virtual AppListModel* GetModel() OVERRIDE; | 54 virtual AppListModel* GetModel() OVERRIDE; |
51 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 55 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
52 virtual SpeechUIModel* GetSpeechUI() OVERRIDE; | 56 virtual SpeechUIModel* GetSpeechUI() OVERRIDE; |
53 virtual void GetShortcutPathForApp( | 57 virtual void GetShortcutPathForApp( |
54 const std::string& app_id, | 58 const std::string& app_id, |
55 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 59 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
56 virtual void StartSearch() OVERRIDE {} | 60 virtual void StartSearch() OVERRIDE {} |
57 virtual void StopSearch() OVERRIDE {} | 61 virtual void StopSearch() OVERRIDE {} |
58 virtual void OpenSearchResult(SearchResult* result, | 62 virtual void OpenSearchResult(SearchResult* result, |
59 bool auto_launch, | 63 bool auto_launch, |
(...skipping 22 matching lines...) Expand all Loading... |
82 | 86 |
83 // Do a bulk replacement of the items in the model. | 87 // Do a bulk replacement of the items in the model. |
84 void ReplaceTestModel(int item_count); | 88 void ReplaceTestModel(int item_count); |
85 | 89 |
86 AppListTestModel* ReleaseTestModel() { return model_.release(); } | 90 AppListTestModel* ReleaseTestModel() { return model_.release(); } |
87 AppListTestModel* GetTestModel() { return model_.get(); } | 91 AppListTestModel* GetTestModel() { return model_.get(); } |
88 | 92 |
89 private: | 93 private: |
90 int dismiss_count_; | 94 int dismiss_count_; |
91 int open_search_result_count_; | 95 int open_search_result_count_; |
| 96 int next_profile_app_count_; |
92 std::map<size_t, int> open_search_result_counts_; | 97 std::map<size_t, int> open_search_result_counts_; |
93 Users users_; | 98 Users users_; |
94 scoped_ptr<TestSigninDelegate> test_signin_delegate_; | 99 scoped_ptr<TestSigninDelegate> test_signin_delegate_; |
95 scoped_ptr<AppListTestModel> model_; | 100 scoped_ptr<AppListTestModel> model_; |
96 ObserverList<AppListViewDelegateObserver> observers_; | 101 ObserverList<AppListViewDelegateObserver> observers_; |
97 SpeechUIModel speech_ui_; | 102 SpeechUIModel speech_ui_; |
98 base::TimeDelta auto_launch_timeout_; | 103 base::TimeDelta auto_launch_timeout_; |
99 | 104 |
100 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); | 105 DISALLOW_COPY_AND_ASSIGN(AppListTestViewDelegate); |
101 }; | 106 }; |
102 | 107 |
103 } // namespace test | 108 } // namespace test |
104 } // namespace app_list | 109 } // namespace app_list |
105 | 110 |
106 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 111 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
OLD | NEW |