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

Unified Diff: chrome/browser/ui/ash/launcher/app_window_launcher_item_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/app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
index 80c2927fccbef89f605e30ddb91b78afd31c62d0..30838c77442b58cb8b8b062752503cf9adeef205 100644
--- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "ash/wm/window_util.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
#include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
@@ -19,8 +20,9 @@ AppWindowLauncherItemController::AppWindowLauncherItemController(
Type type,
const std::string& app_id,
const std::string& launch_id,
+ const std::string& title,
ChromeLauncherController* controller)
- : LauncherItemController(type, app_id, launch_id, controller),
+ : LauncherItemController(type, app_id, launch_id, title, controller),
observed_windows_(this) {}
AppWindowLauncherItemController::~AppWindowLauncherItemController() {}
@@ -134,8 +136,11 @@ AppWindowLauncherItemController::ItemSelected(const ui::Event& event) {
}
base::string16 AppWindowLauncherItemController::GetTitle() {
- return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(),
- app_id());
+ if (!title().empty())
+ return base::UTF8ToUTF16(title());
+ else
+ return LauncherControllerHelper::GetAppTitle(
+ launcher_controller()->profile(), app_id());
}
bool AppWindowLauncherItemController::IsDraggable() {

Powered by Google App Engine
This is Rietveld 408576698