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

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: Fix static cast in AppModelBuilder, add AppType 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
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..77d7005c4fa885c22441242e5cea6957e7cb7b5d 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) {
+ 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

Powered by Google App Engine
This is Rietveld 408576698