| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 toggle_speech_recognition_count_(0), |
| 56 open_search_result_count_(0), | 56 open_search_result_count_(0), |
| 57 next_profile_app_count_(0), |
| 57 test_signin_delegate_(new TestSigninDelegate), | 58 test_signin_delegate_(new TestSigninDelegate), |
| 58 model_(new AppListTestModel), | 59 model_(new AppListTestModel), |
| 59 speech_ui_(SPEECH_RECOGNITION_OFF) { | 60 speech_ui_(SPEECH_RECOGNITION_OFF) { |
| 60 } | 61 } |
| 61 | 62 |
| 62 AppListTestViewDelegate::~AppListTestViewDelegate() {} | 63 AppListTestViewDelegate::~AppListTestViewDelegate() {} |
| 63 | 64 |
| 64 void AppListTestViewDelegate::SetSignedIn(bool signed_in) { | 65 void AppListTestViewDelegate::SetSignedIn(bool signed_in) { |
| 65 test_signin_delegate_->set_signed_in(signed_in); | 66 test_signin_delegate_->set_signed_in(signed_in); |
| 66 FOR_EACH_OBSERVER(AppListViewDelegateObserver, | 67 FOR_EACH_OBSERVER(AppListViewDelegateObserver, |
| 67 observers_, | 68 observers_, |
| 68 OnProfilesChanged()); | 69 OnProfilesChanged()); |
| 69 } | 70 } |
| 70 | 71 |
| 71 int AppListTestViewDelegate::GetToggleSpeechRecognitionCountAndReset() { | 72 int AppListTestViewDelegate::GetToggleSpeechRecognitionCountAndReset() { |
| 72 int count = toggle_speech_recognition_count_; | 73 int count = toggle_speech_recognition_count_; |
| 73 toggle_speech_recognition_count_ = 0; | 74 toggle_speech_recognition_count_ = 0; |
| 74 return count; | 75 return count; |
| 75 } | 76 } |
| 76 | 77 |
| 77 bool AppListTestViewDelegate::ForceNativeDesktop() const { | 78 bool AppListTestViewDelegate::ForceNativeDesktop() const { |
| 78 return false; | 79 return false; |
| 79 } | 80 } |
| 80 | 81 |
| 82 void AppListTestViewDelegate::SetProfileByPath( |
| 83 const base::FilePath& profile_path) { |
| 84 ReplaceTestModel(next_profile_app_count_); |
| 85 } |
| 86 |
| 81 AppListModel* AppListTestViewDelegate::GetModel() { | 87 AppListModel* AppListTestViewDelegate::GetModel() { |
| 82 return model_.get(); | 88 return model_.get(); |
| 83 } | 89 } |
| 84 | 90 |
| 85 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { | 91 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { |
| 86 return test_signin_delegate_.get(); | 92 return test_signin_delegate_.get(); |
| 87 } | 93 } |
| 88 | 94 |
| 89 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { | 95 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { |
| 90 return &speech_ui_; | 96 return &speech_ui_; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 observers_.AddObserver(observer); | 161 observers_.AddObserver(observer); |
| 156 } | 162 } |
| 157 | 163 |
| 158 void AppListTestViewDelegate::RemoveObserver( | 164 void AppListTestViewDelegate::RemoveObserver( |
| 159 AppListViewDelegateObserver* observer) { | 165 AppListViewDelegateObserver* observer) { |
| 160 observers_.RemoveObserver(observer); | 166 observers_.RemoveObserver(observer); |
| 161 } | 167 } |
| 162 | 168 |
| 163 } // namespace test | 169 } // namespace test |
| 164 } // namespace app_list | 170 } // namespace app_list |
| OLD | NEW |