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

Side by Side Diff: ui/app_list/test/app_list_test_model.cc

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 4 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_model.h" 5 #include "ui/app_list/test/app_list_test_model.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "ui/app_list/app_list_item_model.h" 8 #include "ui/app_list/app_list_item_model.h"
9 9
10 namespace app_list { 10 namespace app_list {
11 namespace test { 11 namespace test {
12 12
13 AppListTestModel::AppListTestModel() {
14 SetSignedIn(true);
15 }
16
13 void AppListTestModel::PopulateApps(int n) { 17 void AppListTestModel::PopulateApps(int n) {
14 for (int i = 0; i < n; ++i) 18 for (int i = 0; i < n; ++i)
15 AddItem(base::StringPrintf("Item %d", i)); 19 AddItem(base::StringPrintf("Item %d", i));
16 } 20 }
17 21
18 void AppListTestModel::PopulateAppWithId(int id) { 22 void AppListTestModel::PopulateAppWithId(int id) {
19 AddItem(base::StringPrintf("Item %d", id)); 23 AddItem(base::StringPrintf("Item %d", id));
20 } 24 }
21 25
22 std::string AppListTestModel::GetModelContent() { 26 std::string AppListTestModel::GetModelContent() {
(...skipping 16 matching lines...) Expand all
39 apps()->Add(CreateItem(title)); 43 apps()->Add(CreateItem(title));
40 } 44 }
41 45
42 void AppListTestModel::HighlightItemAt(int index) { 46 void AppListTestModel::HighlightItemAt(int index) {
43 AppListItemModel* item = apps()->GetItemAt(index); 47 AppListItemModel* item = apps()->GetItemAt(index);
44 item->SetHighlighted(true); 48 item->SetHighlighted(true);
45 } 49 }
46 50
47 } // namespace test 51 } // namespace test
48 } // namespace app_list 52 } // namespace app_list
OLDNEW
« 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