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

Unified Diff: chrome/browser/webshare/share_target_pref_helper.h

Issue 2639463002: Add a pref name for share targets, and store their manifest data. (Closed)
Patch Set: Separate tests, add .h, as per feedback Created 3 years, 11 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/webshare/share_target_pref_helper.h
diff --git a/chrome/browser/webshare/share_target_pref_helper.h b/chrome/browser/webshare/share_target_pref_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..943c5da0067e2ab38ad3ad14e633b911312be1a7
--- /dev/null
+++ b/chrome/browser/webshare/share_target_pref_helper.h
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
+#define CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
+
+#include "base/optional.h"
+#include "base/strings/string_piece.h"
+#include "base/values.h"
Matt Giuca 2017/01/24 03:26:09 This isn't needed here -- move it into the .cc fil
constantina 2017/01/24 23:39:04 Done.
+#include "components/prefs/pref_service.h"
Matt Giuca 2017/01/24 03:26:09 This can be forward-declared, since you only refer
constantina 2017/01/24 23:39:04 Done.
+#include "components/prefs/scoped_user_pref_update.h"
Matt Giuca 2017/01/24 03:26:09 This isn't needed.
constantina 2017/01/24 23:39:04 Done.
+#include "content/public/common/manifest.h"
Matt Giuca 2017/01/24 03:26:09 Nor is this. Only include headers you need to ref
constantina 2017/01/24 23:39:04 Done.
+
+namespace webshare {
+
+// Adds the Web Share target |share_target_origin| with template |url_template|
+// to |pref_service| under kWebShareVisitedTargets. If |url_template| is null,
+// this function will remove |share_target_origin| from kWebShareVisitedTargets,
+// if it is there.
+void AddShareTargetToPrefs(base::StringPiece share_target_origin,
Matt Giuca 2017/01/24 03:26:09 This is no longer an origin, but a full URL to the
constantina 2017/01/24 23:39:04 Done.
+ base::Optional<std::string> url_template,
+ PrefService* pref_service);
+
+} // namespace webshare
+
+#endif // CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698