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

Unified Diff: chrome/browser/ui/ash/launcher/launcher_item_controller.cc

Issue 1921403002: Pin apps from prefs on the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only include arc for cros. Created 4 years, 8 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: chrome/browser/ui/ash/launcher/launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/launcher_item_controller.cc
index c6c35dd429bb7420fb9a4790aa22a79b098520b7..67a68dbd90cdd2130121c762875cdd87ae92392e 100644
--- a/chrome/browser/ui/ash/launcher/launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_item_controller.cc
@@ -23,29 +23,24 @@ LauncherItemController::LauncherItemController(
shelf_id_(0),
launcher_controller_(launcher_controller),
locked_(0),
- image_set_by_controller_(false) {
-}
-
-LauncherItemController::~LauncherItemController() {
-}
+ image_set_by_controller_(false) {}
-const std::string& LauncherItemController::app_id() const {
- return app_id_;
-}
+LauncherItemController::~LauncherItemController() {}
-base::string16 LauncherItemController::GetAppTitle() const {
+// static
+base::string16 LauncherItemController::GetAppTitle(Profile* profile,
+ const std::string& app_id) {
base::string16 title;
- if (app_id_.empty())
+ if (app_id.empty())
return title;
#if defined(OS_CHROMEOS)
// Get title if the app is an Arc app
- ArcAppListPrefs* arc_prefs =
- ArcAppListPrefs::Get(launcher_controller_->profile());
+ ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile);
DCHECK(arc_prefs);
- if (arc_prefs->IsRegistered(app_id_)) {
+ if (arc_prefs->IsRegistered(app_id)) {
std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
- arc_prefs->GetApp(app_id_);
+ arc_prefs->GetApp(app_id);
DCHECK(app_info.get());
if (app_info)
title = base::UTF8ToUTF16(app_info->name);
@@ -54,9 +49,8 @@ base::string16 LauncherItemController::GetAppTitle() const {
#endif // defined(OS_CHROMEOS)
const extensions::Extension* extension =
- extensions::ExtensionRegistry::Get(
- launcher_controller_->profile())->GetExtensionById(
- app_id_, extensions::ExtensionRegistry::EVERYTHING);
+ extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
+ app_id, extensions::ExtensionRegistry::EVERYTHING);
if (extension)
title = base::UTF8ToUTF16(extension->name());
return title;

Powered by Google App Engine
This is Rietveld 408576698