| 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" |
| 11 #include "ui/app_list/app_list_model.h" | 11 #include "ui/app_list/app_list_model.h" |
| 12 #include "ui/app_list/test/app_list_test_model.h" | 12 #include "ui/app_list/test/app_list_test_model.h" |
| 13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
| 14 | 14 |
| 15 namespace app_list { | 15 namespace app_list { |
| 16 namespace test { | 16 namespace test { |
| 17 | 17 |
| 18 AppListTestViewDelegate::AppListTestViewDelegate() | 18 AppListTestViewDelegate::AppListTestViewDelegate() |
| 19 : dismiss_count_(0), | 19 : dismiss_count_(0), |
| 20 open_search_result_count_(0), |
| 20 test_signin_delegate_(NULL), | 21 test_signin_delegate_(NULL), |
| 21 model_(new AppListTestModel) { | 22 model_(new AppListTestModel) { |
| 22 } | 23 } |
| 23 | 24 |
| 24 AppListTestViewDelegate::~AppListTestViewDelegate() {} | 25 AppListTestViewDelegate::~AppListTestViewDelegate() {} |
| 25 | 26 |
| 26 bool AppListTestViewDelegate::ForceNativeDesktop() const { | 27 bool AppListTestViewDelegate::ForceNativeDesktop() const { |
| 27 return false; | 28 return false; |
| 28 } | 29 } |
| 29 | 30 |
| 30 AppListModel* AppListTestViewDelegate::GetModel() { | 31 AppListModel* AppListTestViewDelegate::GetModel() { |
| 31 return model_.get(); | 32 return model_.get(); |
| 32 } | 33 } |
| 33 | 34 |
| 34 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { | 35 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { |
| 35 return test_signin_delegate_; | 36 return test_signin_delegate_; |
| 36 } | 37 } |
| 37 | 38 |
| 38 void AppListTestViewDelegate::GetShortcutPathForApp( | 39 void AppListTestViewDelegate::GetShortcutPathForApp( |
| 39 const std::string& app_id, | 40 const std::string& app_id, |
| 40 const base::Callback<void(const base::FilePath&)>& callback) { | 41 const base::Callback<void(const base::FilePath&)>& callback) { |
| 41 callback.Run(base::FilePath()); | 42 callback.Run(base::FilePath()); |
| 42 } | 43 } |
| 43 | 44 |
| 45 void AppListTestViewDelegate::OpenSearchResult(SearchResult* result, |
| 46 int event_flags) { |
| 47 ++open_search_result_count_; |
| 48 } |
| 49 |
| 44 void AppListTestViewDelegate::Dismiss() { | 50 void AppListTestViewDelegate::Dismiss() { |
| 45 ++dismiss_count_; | 51 ++dismiss_count_; |
| 46 } | 52 } |
| 47 | 53 |
| 48 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { | 54 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { |
| 49 return gfx::ImageSkia(); | 55 return gfx::ImageSkia(); |
| 50 } | 56 } |
| 51 | 57 |
| 52 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { | 58 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { |
| 53 return NULL; | 59 return NULL; |
| 54 } | 60 } |
| 55 | 61 |
| 56 const AppListViewDelegate::Users& AppListTestViewDelegate::GetUsers() const { | 62 const AppListViewDelegate::Users& AppListTestViewDelegate::GetUsers() const { |
| 57 return users_; | 63 return users_; |
| 58 } | 64 } |
| 59 | 65 |
| 60 void AppListTestViewDelegate::ReplaceTestModel(int item_count) { | 66 void AppListTestViewDelegate::ReplaceTestModel(int item_count) { |
| 61 model_.reset(new AppListTestModel); | 67 model_.reset(new AppListTestModel); |
| 62 model_->PopulateApps(item_count); | 68 model_->PopulateApps(item_count); |
| 63 } | 69 } |
| 64 | 70 |
| 65 } // namespace test | 71 } // namespace test |
| 66 } // namespace app_list | 72 } // namespace app_list |
| OLD | NEW |