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

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: Rebase 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 138cec71e67b9313cdfbe6c35c00f69db23076ab..73a24e7ef60340887eda2450632f4596747d9028 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();
@@ -167,9 +174,10 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
} else {
LauncherItemController::Type type = 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