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

Unified Diff: chrome/browser/android/shortcut_info.cc

Issue 1224273003: webapps: propogate name and shortName from manifest to Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back explict destructor Created 5 years, 5 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/android/shortcut_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_info.cc
diff --git a/chrome/browser/android/shortcut_info.cc b/chrome/browser/android/shortcut_info.cc
index 67e0c5549c344667fdc39db4fc854bd8da65ea7d..f1da10a3c96b040df9bcb95d144b54acd05b3d40 100644
--- a/chrome/browser/android/shortcut_info.cc
+++ b/chrome/browser/android/shortcut_info.cc
@@ -17,11 +17,21 @@ ShortcutInfo::ShortcutInfo(const GURL& shortcut_url)
source(SOURCE_ADD_TO_HOMESCREEN) {
}
+ShortcutInfo::~ShortcutInfo() {
+}
+
void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) {
if (!manifest.short_name.is_null())
- title = manifest.short_name.string();
- else if (!manifest.name.is_null())
- title = manifest.name.string();
+ short_name = manifest.short_name.string();
+ if (!manifest.name.is_null())
+ name = manifest.name.string();
+ if (manifest.short_name.is_null() != manifest.name.is_null()) {
+ if (manifest.short_name.is_null())
+ short_name = name;
+ name = short_name;
+ }
+ if (!short_name.empty())
+ user_title = short_name;
// Set the url based on the manifest value, if any.
if (manifest.start_url.is_valid())
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698