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

Unified Diff: extensions/browser/app_window/app_window.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: extensions/browser/app_window/app_window.cc
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc
index 67c5019fed46c095e8be287eeb014e22f6758626..4390123b7cb70a92f3bda655578df15251517cfe 100644
--- a/extensions/browser/app_window/app_window.cc
+++ b/extensions/browser/app_window/app_window.cc
@@ -300,6 +300,7 @@ void AppWindow::Init(const GURL& url,
is_ime_window_ = params.is_ime_window;
show_in_shelf_ = params.show_in_shelf;
window_icon_url_ = params.window_icon_url;
+ title_ = params.title;
AppWindowClient* app_window_client = AppWindowClient::Get();
native_app_window_.reset(
@@ -581,7 +582,11 @@ base::string16 AppWindow::GetTitle() const {
content::NavigationEntry* entry = web_contents() ?
web_contents()->GetController().GetLastCommittedEntry() : nullptr;
if (!entry || entry->GetTitle().empty()) {
- title = base::UTF8ToUTF16(extension->name());
+ if (!title_.empty()) {
+ title = base::UTF8ToUTF16(title_);
+ } else {
+ title = base::UTF8ToUTF16(extension->name());
+ }
} else {
title = web_contents()->GetTitle();
}

Powered by Google App Engine
This is Rietveld 408576698