Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Unified Diff: ui/app_list/test/app_list_test_model.cc

Issue 25859005: Elim ActivateAppListItem, ChromeAppListItem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fixes Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/test/app_list_test_model.h ('k') | ui/app_list/test/app_list_test_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/test/app_list_test_model.cc
diff --git a/ui/app_list/test/app_list_test_model.cc b/ui/app_list/test/app_list_test_model.cc
index 394514ef12cd94dba6e90da37c2bd6d04ea6d3bd..6e059a9b7cd0a7d7c69f99fd4aca41a4d3bbde2e 100644
--- a/ui/app_list/test/app_list_test_model.cc
+++ b/ui/app_list/test/app_list_test_model.cc
@@ -10,7 +10,25 @@
namespace app_list {
namespace test {
-AppListTestModel::AppListTestModel() {
+class AppListTestModel::AppListTestItemModel : public AppListItemModel {
+ public:
+ explicit AppListTestItemModel(AppListTestModel* model)
+ : model_(model) {
+ }
+ virtual ~AppListTestItemModel() {}
+
+ virtual void Activate(int event_flags) OVERRIDE {
+ model_->ItemActivated(this);
+ }
+
+ private:
+ AppListTestModel* model_;
+ DISALLOW_COPY_AND_ASSIGN(AppListTestItemModel);
+};
+
+AppListTestModel::AppListTestModel()
+ : activate_count_(0),
+ last_activated_(NULL) {
SetSignedIn(true);
}
@@ -54,5 +72,10 @@ void AppListTestModel::HighlightItemAt(int index) {
item->SetHighlighted(true);
}
+void AppListTestModel::ItemActivated(AppListTestItemModel* item) {
+ last_activated_ = item;
+ ++activate_count_;
+}
+
} // namespace test
} // namespace app_list
« no previous file with comments | « ui/app_list/test/app_list_test_model.h ('k') | ui/app_list/test/app_list_test_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698