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..511564a22f90c99dfb32a66c98d30125335668bf |
--- /dev/null |
+++ b/chrome/browser/webshare/share_target_pref_helper.h |
@@ -0,0 +1,21 @@ |
+// 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" |
+ |
+class PrefService; |
+ |
+// 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 UpdateShareTargetInPrefs(base::StringPiece manifest_url, |
+ base::Optional<std::string> url_template, |
+ PrefService* pref_service); |
+ |
+#endif // CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ |