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

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

Issue 2627533002: Replace ShelfItemDelegate::GetTitle() with ShelfItem::title. (Closed)
Patch Set: Address comments. Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
index 06423c8cb0b7efb5ce5e51b0c446f4dfaa226e09..6efa7f3d8fa7e0b414b0634e1bda91b54c720dd3 100644
--- a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
+#include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/extensions/app_launch_params.h"
#include "chrome/browser/ui/extensions/application_launch.h"
@@ -103,25 +104,25 @@ LauncherControllerHelper::~LauncherControllerHelper() {}
base::string16 LauncherControllerHelper::GetAppTitle(
Profile* profile,
const std::string& app_id) {
- base::string16 title;
if (app_id.empty())
- return title;
+ return base::string16();
- // Get title if the app is an Arc app.
+ // Get the title if the app is an Arc app.
ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile);
- if (arc_prefs && arc_prefs->IsRegistered(app_id)) {
+ const std::string arc_app_id =
+ ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id);
+ if (arc_prefs && arc_prefs->IsRegistered(arc_app_id)) {
std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
- arc_prefs->GetApp(app_id);
+ arc_prefs->GetApp(arc_app_id);
DCHECK(app_info.get());
if (app_info)
- title = base::UTF8ToUTF16(app_info->name);
- return title;
+ return base::UTF8ToUTF16(app_info->name);
}
const extensions::Extension* extension = GetExtensionByID(profile, app_id);
if (extension)
- title = base::UTF8ToUTF16(extension->name());
- return title;
+ return base::UTF8ToUTF16(extension->name());
+ return base::string16();
}
std::string LauncherControllerHelper::GetAppID(content::WebContents* tab) {
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698