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

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

Issue 23709003: Display an app's short name in the app launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation errors in app list unit tests on mac Created 7 years, 3 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/views/app_list_item_view.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 {
(...skipping 15 matching lines...) Expand all
26 std::string AppListTestModel::GetModelContent() { 26 std::string AppListTestModel::GetModelContent() {
27 std::string content; 27 std::string content;
28 for (size_t i = 0; i < apps()->item_count(); ++i) { 28 for (size_t i = 0; i < apps()->item_count(); ++i) {
29 if (i > 0) 29 if (i > 0)
30 content += ','; 30 content += ',';
31 content += apps()->GetItemAt(i)->title(); 31 content += apps()->GetItemAt(i)->title();
32 } 32 }
33 return content; 33 return content;
34 } 34 }
35 35
36 AppListItemModel* AppListTestModel::CreateItem(const std::string& title) { 36 AppListItemModel* AppListTestModel::CreateItem(const std::string& title,
37 const std::string& full_name) {
37 AppListItemModel* item = new AppListItemModel; 38 AppListItemModel* item = new AppListItemModel;
38 item->SetTitle(title); 39 item->SetTitleAndFullName(title, full_name);
39 return item; 40 return item;
40 } 41 }
41 42
42 void AppListTestModel::AddItem(const std::string& title) { 43 void AppListTestModel::AddItem(const std::string& title) {
43 apps()->Add(CreateItem(title)); 44 apps()->Add(CreateItem(title, title));
45 }
46
47 void AppListTestModel::AddItem(const std::string& title,
48 const std::string& full_name) {
49 apps()->Add(CreateItem(title, full_name));
44 } 50 }
45 51
46 void AppListTestModel::HighlightItemAt(int index) { 52 void AppListTestModel::HighlightItemAt(int index) {
47 AppListItemModel* item = apps()->GetItemAt(index); 53 AppListItemModel* item = apps()->GetItemAt(index);
48 item->SetHighlighted(true); 54 item->SetHighlighted(true);
49 } 55 }
50 56
51 } // namespace test 57 } // namespace test
52 } // namespace app_list 58 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/test/app_list_test_model.h ('k') | ui/app_list/views/app_list_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698