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

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

Issue 2484413002: Enhance chrome.app.window API with title property
Patch Set: Created 4 years, 1 month 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/extension_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
index a01461a6e50770048e3e8ef172edf88c928cdf49..c1cc344f2bddb7a4038ff0e5549cbb4aa614824b 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
@@ -41,6 +41,13 @@ std::string GetLaunchId(AppWindow* app_window) {
return launch_id;
}
+std::string GetTitle(AppWindow* app_window) {
+ if (app_window->show_in_shelf())
+ return app_window->title();
+ else
+ return base::EmptyString();
+}
+
std::string GetAppShelfId(AppWindow* app_window) {
// Set app_shelf_id value to app_id and then append launch_id.
std::string app_id = app_window->extension_id();
@@ -156,9 +163,10 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
? LauncherItemController::TYPE_APP_PANEL
: LauncherItemController::TYPE_APP;
std::string launch_id = GetLaunchId(app_window);
+ std::string title = GetTitle(app_window);
ExtensionAppWindowLauncherItemController* controller =
new ExtensionAppWindowLauncherItemController(type, app_id, launch_id,
- owner());
+ title, owner());
controller->AddAppWindow(app_window);
// If there is already a shelf id mapped to this app_shelf_id (e.g. pinned),
// use that shelf item.

Powered by Google App Engine
This is Rietveld 408576698