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

Unified Diff: chrome/browser/extensions/bookmark_app_helper.cc

Issue 2679523002: Store target app name in Web Share prefs, and add extra logic. (Closed)
Patch Set: My nits Created 3 years, 10 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
Index: chrome/browser/extensions/bookmark_app_helper.cc
diff --git a/chrome/browser/extensions/bookmark_app_helper.cc b/chrome/browser/extensions/bookmark_app_helper.cc
index ed908ba1487a0fc863e0d82019bf7e22159560e7..4e07425b993540d54eb48a59391bffe2d354c129 100644
--- a/chrome/browser/extensions/bookmark_app_helper.cc
+++ b/chrome/browser/extensions/bookmark_app_helper.cc
@@ -586,19 +586,7 @@ void BookmarkAppHelper::OnDidGetManifest(const GURL& manifest_url,
UpdateWebAppInfoFromManifest(manifest, &web_app_info_);
if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) {
Matt Giuca 2017/02/06 00:40:11 Drop the braces (for consistency with surrounding
constantina 2017/02/07 05:16:25 Done.
- const std::string& manifest_url_string = manifest_url.spec();
-
- base::Optional<std::string> url_template;
- if (manifest.share_target.has_value() &&
- !manifest.share_target.value().url_template.is_null()) {
- url_template = base::Optional<std::string>(base::UTF16ToUTF8(
- manifest.share_target.value().url_template.string()));
- }
-
- // Add this site as a share target, if it declares a url_template in its
- // manifest, or remove if it doesn't.
- UpdateShareTargetInPrefs(manifest_url_string, std::move(url_template),
- profile_->GetPrefs());
+ UpdateShareTargetInPrefs(manifest_url, manifest, profile_->GetPrefs());
Matt Giuca 2017/02/06 00:40:11 Nice refactor.
constantina 2017/02/07 05:16:25 Ty!
}
// Add urls from the WebApplicationInfo.
« no previous file with comments | « no previous file | chrome/browser/webshare/share_target_pref_helper.h » ('j') | chrome/browser/webshare/share_target_pref_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698