| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 open_search_result_count_(0), | 55 open_search_result_count_(0), |
| 56 next_profile_app_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 |
| 70 bool AppListTestViewDelegate::ForceNativeDesktop() const { | 71 bool AppListTestViewDelegate::ForceNativeDesktop() const { |
| 71 return false; | 72 return false; |
| 72 } | 73 } |
| 73 | 74 |
| 75 void AppListTestViewDelegate::SetProfileByPath( |
| 76 const base::FilePath& profile_path) { |
| 77 ReplaceTestModel(next_profile_app_count_); |
| 78 } |
| 79 |
| 74 AppListModel* AppListTestViewDelegate::GetModel() { | 80 AppListModel* AppListTestViewDelegate::GetModel() { |
| 75 return model_.get(); | 81 return model_.get(); |
| 76 } | 82 } |
| 77 | 83 |
| 78 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { | 84 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { |
| 79 return test_signin_delegate_.get(); | 85 return test_signin_delegate_.get(); |
| 80 } | 86 } |
| 81 | 87 |
| 82 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { | 88 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { |
| 83 return &speech_ui_; | 89 return &speech_ui_; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 observers_.AddObserver(observer); | 150 observers_.AddObserver(observer); |
| 145 } | 151 } |
| 146 | 152 |
| 147 void AppListTestViewDelegate::RemoveObserver( | 153 void AppListTestViewDelegate::RemoveObserver( |
| 148 AppListViewDelegateObserver* observer) { | 154 AppListViewDelegateObserver* observer) { |
| 149 observers_.RemoveObserver(observer); | 155 observers_.RemoveObserver(observer); |
| 150 } | 156 } |
| 151 | 157 |
| 152 } // namespace test | 158 } // namespace test |
| 153 } // namespace app_list | 159 } // namespace app_list |
| OLD | NEW |