Chromium Code Reviews| 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 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 5 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
| 11 | 11 |
| 12 namespace app_list { | 12 namespace app_list { |
| 13 namespace test { | 13 namespace test { |
| 14 | 14 |
| 15 // A concrete AppListViewDelegate for unit tests. | 15 // A concrete AppListViewDelegate for unit tests. |
| 16 class AppListTestViewDelegate : public AppListViewDelegate { | 16 class AppListTestViewDelegate : public AppListViewDelegate { |
| 17 public: | 17 public: |
| 18 AppListTestViewDelegate(); | 18 AppListTestViewDelegate(); |
| 19 virtual ~AppListTestViewDelegate(); | 19 virtual ~AppListTestViewDelegate(); |
| 20 | 20 |
| 21 int dismiss_count() { return dismiss_count_; } | 21 int dismiss_count() { return dismiss_count_; } |
| 22 void set_test_signin_delegate(SigninDelegate* signin_delegate) { | 22 void set_test_signin_delegate(SigninDelegate* signin_delegate) { |
| 23 test_signin_delegate_ = signin_delegate; | 23 test_signin_delegate_ = signin_delegate; |
| 24 } | 24 } |
| 25 | 25 |
| 26 void SetUsers(const Users& users) { | |
| 27 users_ = users; | |
| 28 } | |
| 29 | |
| 26 // AppListViewDelegate overrides: | 30 // AppListViewDelegate overrides: |
| 27 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} | 31 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {} |
| 28 virtual void InitModel(AppListModel* model) OVERRIDE {} | 32 virtual void InitModel(AppListModel* model) OVERRIDE {} |
| 29 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; | 33 virtual SigninDelegate* GetSigninDelegate() OVERRIDE; |
| 30 virtual void GetShortcutPathForApp( | 34 virtual void GetShortcutPathForApp( |
| 31 const std::string& app_id, | 35 const std::string& app_id, |
| 32 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 36 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
| 33 virtual void StartSearch() OVERRIDE {} | 37 virtual void StartSearch() OVERRIDE {} |
| 34 virtual void StopSearch() OVERRIDE {} | 38 virtual void StopSearch() OVERRIDE {} |
| 35 virtual void OpenSearchResult(SearchResult* result, | 39 virtual void OpenSearchResult(SearchResult* result, |
| 36 int event_flags) OVERRIDE {} | 40 int event_flags) OVERRIDE {} |
| 37 virtual void InvokeSearchResultAction(SearchResult* result, | 41 virtual void InvokeSearchResultAction(SearchResult* result, |
| 38 int action_index, | 42 int action_index, |
| 39 int event_flags) OVERRIDE {} | 43 int event_flags) OVERRIDE {} |
| 40 virtual void Dismiss() OVERRIDE; | 44 virtual void Dismiss() OVERRIDE; |
| 41 virtual void ViewClosing() OVERRIDE {} | 45 virtual void ViewClosing() OVERRIDE {} |
| 42 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 46 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
| 43 virtual void OpenSettings() OVERRIDE {} | 47 virtual void OpenSettings() OVERRIDE {} |
| 44 virtual void OpenHelp() OVERRIDE {} | 48 virtual void OpenHelp() OVERRIDE {} |
| 45 virtual void OpenFeedback() OVERRIDE {} | 49 virtual void OpenFeedback() OVERRIDE {} |
| 46 virtual void ShowForProfileByPath( | 50 virtual void ShowForProfileByPath( |
| 47 const base::FilePath& profile_path) OVERRIDE {}; | 51 const base::FilePath& profile_path) OVERRIDE {}; |
| 48 virtual content::WebContents* GetStartPageContents() OVERRIDE; | 52 virtual content::WebContents* GetStartPageContents() OVERRIDE; |
| 53 virtual const Users& GetUsers() const OVERRIDE; | |
| 49 | 54 |
| 50 private: | 55 private: |
| 51 int dismiss_count_; | 56 int dismiss_count_; |
| 57 Users users_; | |
| 52 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. | 58 SigninDelegate* test_signin_delegate_; // Weak. Owned by test. |
| 59 | |
|
xiyuan
2013/11/06 23:49:29
nit: add DISALLOW_COPY_AND_ASSIGN?
| |
| 53 }; | 60 }; |
| 54 | 61 |
| 55 } // namespace test | 62 } // namespace test |
| 56 } // namespace app_list | 63 } // namespace app_list |
| 57 | 64 |
| 58 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ | 65 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_VIEW_DELEGATE_H_ |
| OLD | NEW |