| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 AppListTestViewDelegate::~AppListTestViewDelegate() {} | 29 AppListTestViewDelegate::~AppListTestViewDelegate() {} |
| 30 | 30 |
| 31 int AppListTestViewDelegate::GetStopSpeechRecognitionCountAndReset() { | 31 int AppListTestViewDelegate::GetStopSpeechRecognitionCountAndReset() { |
| 32 int count = stop_speech_recognition_count_; | 32 int count = stop_speech_recognition_count_; |
| 33 stop_speech_recognition_count_ = 0; | 33 stop_speech_recognition_count_ = 0; |
| 34 return count; | 34 return count; |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool AppListTestViewDelegate::ForceNativeDesktop() const { | |
| 38 return false; | |
| 39 } | |
| 40 | |
| 41 void AppListTestViewDelegate::SetProfileByPath( | |
| 42 const base::FilePath& profile_path) { | |
| 43 ReplaceTestModel(next_profile_app_count_); | |
| 44 } | |
| 45 | |
| 46 AppListModel* AppListTestViewDelegate::GetModel() { | 37 AppListModel* AppListTestViewDelegate::GetModel() { |
| 47 return model_.get(); | 38 return model_.get(); |
| 48 } | 39 } |
| 49 | 40 |
| 50 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { | 41 SpeechUIModel* AppListTestViewDelegate::GetSpeechUI() { |
| 51 return &speech_ui_; | 42 return &speech_ui_; |
| 52 } | 43 } |
| 53 | 44 |
| 54 void AppListTestViewDelegate::OpenSearchResult(SearchResult* result, | 45 void AppListTestViewDelegate::OpenSearchResult(SearchResult* result, |
| 55 bool auto_launch, | 46 bool auto_launch, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 73 } | 64 } |
| 74 | 65 |
| 75 void AppListTestViewDelegate::Dismiss() { | 66 void AppListTestViewDelegate::Dismiss() { |
| 76 ++dismiss_count_; | 67 ++dismiss_count_; |
| 77 } | 68 } |
| 78 | 69 |
| 79 void AppListTestViewDelegate::StopSpeechRecognition() { | 70 void AppListTestViewDelegate::StopSpeechRecognition() { |
| 80 ++stop_speech_recognition_count_; | 71 ++stop_speech_recognition_count_; |
| 81 } | 72 } |
| 82 | 73 |
| 83 #if defined(TOOLKIT_VIEWS) | |
| 84 views::View* AppListTestViewDelegate::CreateStartPageWebView( | 74 views::View* AppListTestViewDelegate::CreateStartPageWebView( |
| 85 const gfx::Size& size) { | 75 const gfx::Size& size) { |
| 86 return NULL; | 76 return NULL; |
| 87 } | 77 } |
| 88 std::vector<views::View*> AppListTestViewDelegate::CreateCustomPageWebViews( | 78 std::vector<views::View*> AppListTestViewDelegate::CreateCustomPageWebViews( |
| 89 const gfx::Size& size) { | 79 const gfx::Size& size) { |
| 90 return std::vector<views::View*>(); | 80 return std::vector<views::View*>(); |
| 91 } | 81 } |
| 92 #endif | |
| 93 | 82 |
| 94 bool AppListTestViewDelegate::IsSpeechRecognitionEnabled() { | 83 bool AppListTestViewDelegate::IsSpeechRecognitionEnabled() { |
| 95 return false; | 84 return false; |
| 96 } | 85 } |
| 97 | 86 |
| 98 const AppListViewDelegate::Users& AppListTestViewDelegate::GetUsers() const { | |
| 99 return users_; | |
| 100 } | |
| 101 | |
| 102 void AppListTestViewDelegate::ReplaceTestModel(int item_count) { | 87 void AppListTestViewDelegate::ReplaceTestModel(int item_count) { |
| 103 model_.reset(new AppListTestModel); | 88 model_.reset(new AppListTestModel); |
| 104 model_->PopulateApps(item_count); | 89 model_->PopulateApps(item_count); |
| 105 } | 90 } |
| 106 | 91 |
| 107 } // namespace test | 92 } // namespace test |
| 108 } // namespace app_list | 93 } // namespace app_list |
| OLD | NEW |