Chromium Code Reviews| Index: chrome/browser/android/shortcut_info.cc |
| diff --git a/chrome/browser/android/shortcut_info.cc b/chrome/browser/android/shortcut_info.cc |
| index 7811a601cb7a8f2c9a65c99b17b0d4303967fe1c..87d4c3f012570c29c894f9f0dc949743d365ff2f 100644 |
| --- a/chrome/browser/android/shortcut_info.cc |
| +++ b/chrome/browser/android/shortcut_info.cc |
| @@ -20,16 +20,12 @@ ShortcutInfo::~ShortcutInfo() { |
| } |
| void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { |
|
dominickn
2017/06/02 01:42:25
Please add:
DCHECK(!short_name.empty() || !name.e
pkotwicz
2017/06/02 15:53:53
UpdateManifest() might be called with an empty sho
dominickn
2017/06/06 00:20:58
Good catch. That's not great - it means we'll show
pkotwicz
2017/06/07 02:22:33
Ok, I have changed the logic to be a no-op if the
|
| - if (!manifest.short_name.is_null()) |
| - 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; |
| - else |
| - name = short_name; |
| - } |
| + short_name = manifest.short_name.string(); |
| + name = manifest.name.string(); |
| + if (short_name.empty()) |
| + short_name = name; |
| + else if (name.empty()) |
| + name = short_name; |
| user_title = short_name; |
| // Set the url based on the manifest value, if any. |