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

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: 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
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->SetTitle(title);
40 item->SetFullName(full_name);
39 return item; 41 return item;
40 } 42 }
41 43
42 void AppListTestModel::AddItem(const std::string& title) { 44 void AppListTestModel::AddItem(const std::string& title) {
43 apps()->Add(CreateItem(title)); 45 apps()->Add(CreateItem(title, title));
46 }
47
48 void AppListTestModel::AddItem(const std::string& title,
49 const std::string& full_name) {
50 apps()->Add(CreateItem(title, full_name));
44 } 51 }
45 52
46 void AppListTestModel::HighlightItemAt(int index) { 53 void AppListTestModel::HighlightItemAt(int index) {
47 AppListItemModel* item = apps()->GetItemAt(index); 54 AppListItemModel* item = apps()->GetItemAt(index);
48 item->SetHighlighted(true); 55 item->SetHighlighted(true);
49 } 56 }
50 57
51 } // namespace test 58 } // namespace test
52 } // namespace app_list 59 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698