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_ |