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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "ui/gfx/image/image_skia.h" | 9 #include "ui/gfx/image/image_skia.h" |
10 | 10 |
11 namespace app_list { | 11 namespace app_list { |
12 namespace test { | 12 namespace test { |
13 | 13 |
14 AppListTestViewDelegate::AppListTestViewDelegate() | 14 AppListTestViewDelegate::AppListTestViewDelegate() |
15 : activate_count_(0), | 15 : dismiss_count_(0), |
16 dismiss_count_(0), | |
17 last_activated_(NULL), | |
18 test_signin_delegate_(NULL) { | 16 test_signin_delegate_(NULL) { |
19 } | 17 } |
20 | 18 |
21 AppListTestViewDelegate::~AppListTestViewDelegate() {} | 19 AppListTestViewDelegate::~AppListTestViewDelegate() {} |
22 | 20 |
23 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { | 21 SigninDelegate* AppListTestViewDelegate::GetSigninDelegate() { |
24 return test_signin_delegate_; | 22 return test_signin_delegate_; |
25 } | 23 } |
26 | 24 |
27 void AppListTestViewDelegate::GetShortcutPathForApp( | 25 void AppListTestViewDelegate::GetShortcutPathForApp( |
28 const std::string& app_id, | 26 const std::string& app_id, |
29 const base::Callback<void(const base::FilePath&)>& callback) { | 27 const base::Callback<void(const base::FilePath&)>& callback) { |
30 callback.Run(base::FilePath()); | 28 callback.Run(base::FilePath()); |
31 } | 29 } |
32 | 30 |
33 void AppListTestViewDelegate::ActivateAppListItem(AppListItemModel* item, | |
34 int event_flags) { | |
35 last_activated_ = item; | |
36 ++activate_count_; | |
37 } | |
38 | |
39 void AppListTestViewDelegate::Dismiss() { | 31 void AppListTestViewDelegate::Dismiss() { |
40 ++dismiss_count_; | 32 ++dismiss_count_; |
41 } | 33 } |
42 | 34 |
43 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { | 35 gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() { |
44 return gfx::ImageSkia(); | 36 return gfx::ImageSkia(); |
45 } | 37 } |
46 | 38 |
47 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { | 39 content::WebContents* AppListTestViewDelegate::GetStartPageContents() { |
48 return NULL; | 40 return NULL; |
49 } | 41 } |
50 | 42 |
51 } // namespace test | 43 } // namespace test |
52 } // namespace app_list | 44 } // namespace app_list |
OLD | NEW |