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 #include "ui/app_list/test/app_list_test_view_delegate.h" | 5 #include "ui/app_list/test/app_list_test_view_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 bool signed_in_; | 48 bool signed_in_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(TestSigninDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(TestSigninDelegate); |
51 }; | 51 }; |
52 | 52 |
53 AppListTestViewDelegate::AppListTestViewDelegate() | 53 AppListTestViewDelegate::AppListTestViewDelegate() |
54 : dismiss_count_(0), | 54 : dismiss_count_(0), |
| 55 toggle_speech_recognition_count_(0), |
55 open_search_result_count_(0), | 56 open_search_result_count_(0), |
56 test_signin_delegate_(new TestSigninDelegate), | 57 test_signin_delegate_(new TestSigninDelegate), |
57 model_(new AppListTestModel), | 58 model_(new AppListTestModel), |
58 speech_ui_(SPEECH_RECOGNITION_OFF) { | 59 speech_ui_(SPEECH_RECOGNITION_OFF) { |
59 } | 60 } |
60 | 61 |
61 AppListTestViewDelegate::~AppListTestViewDelegate() {} | 62 AppListTestViewDelegate::~AppListTestViewDelegate() {} |
62 | 63 |
63 void AppListTestViewDelegate::SetSignedIn(bool signed_in) { | 64 void AppListTestViewDelegate::SetSignedIn(bool signed_in) { |
64 test_signin_delegate_->set_signed_in(signed_in); | 65 test_signin_delegate_->set_signed_in(signed_in); |
65 FOR_EACH_OBSERVER(AppListViewDelegateObserver, | 66 FOR_EACH_OBSERVER(AppListViewDelegateObserver, |
66 observers_, | 67 observers_, |
67 OnProfilesChanged()); | 68 OnProfilesChanged()); |
68 } | 69 } |
69 | 70 |
| 71 int AppListTestViewDelegate::GetToggleSpeechRecognitionCountAndReset() { |
| 72 int count = toggle_speech_recognition_count_; |
| 73 toggle_speech_recognition_count_ = 0; |
| 74 return count; |
| 75 } |
| 76 |
70 bool AppListTestViewDelegate::ForceNativeDesktop() const { | 77 bool AppListTestViewDelegate::ForceNativeDesktop() const { |
71 return false; | 78 return false; |
72 } | 79 } |
73 | 80 |
74 AppListModel* AppListTestViewDelegate::GetModel() { | 81 AppListModel* AppListTestViewDelegate::GetModel() { |
75 return model_.get(); | 82 return model_.get(); |
76 } | 83 } |
77 | 84 |
78 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { | 85 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { |
79 return test_signin_delegate_.get(); | 86 return test_signin_delegate_.get(); |
(...skipping 27 matching lines...) Expand all Loading... |
107 } | 114 } |
108 | 115 |
109 void AppListTestViewDelegate::AutoLaunchCanceled() { | 116 void AppListTestViewDelegate::AutoLaunchCanceled() { |
110 auto_launch_timeout_ = base::TimeDelta(); | 117 auto_launch_timeout_ = base::TimeDelta(); |
111 } | 118 } |
112 | 119 |
113 void AppListTestViewDelegate::Dismiss() { | 120 void AppListTestViewDelegate::Dismiss() { |
114 ++dismiss_count_; | 121 ++dismiss_count_; |
115 } | 122 } |
116 | 123 |
| 124 void AppListTestViewDelegate::ToggleSpeechRecognition() { |
| 125 ++toggle_speech_recognition_count_; |
| 126 } |
| 127 |
117 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { | 128 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { |
118 return gfx::ImageSkia(); | 129 return gfx::ImageSkia(); |
119 } | 130 } |
120 | 131 |
121 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { | 132 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { |
122 return NULL; | 133 return NULL; |
123 } | 134 } |
124 | 135 |
125 content::WebContents* AppListTestViewDelegate::GetSpeechRecognitionContents() { | 136 content::WebContents* AppListTestViewDelegate::GetSpeechRecognitionContents() { |
126 return NULL; | 137 return NULL; |
(...skipping 17 matching lines...) Expand all Loading... |
144 observers_.AddObserver(observer); | 155 observers_.AddObserver(observer); |
145 } | 156 } |
146 | 157 |
147 void AppListTestViewDelegate::RemoveObserver( | 158 void AppListTestViewDelegate::RemoveObserver( |
148 AppListViewDelegateObserver* observer) { | 159 AppListViewDelegateObserver* observer) { |
149 observers_.RemoveObserver(observer); | 160 observers_.RemoveObserver(observer); |
150 } | 161 } |
151 | 162 |
152 } // namespace test | 163 } // namespace test |
153 } // namespace app_list | 164 } // namespace app_list |
OLD | NEW |