Index: chrome/browser/webshare/share_service_impl.h |
diff --git a/chrome/browser/webshare/share_service_impl.h b/chrome/browser/webshare/share_service_impl.h |
index 3bc47deae3f5b84fee5fe3b2ca1e73cfcedde381..04ec0d33f6c47076a0b8fc046a3d3d21faac76fb 100644 |
--- a/chrome/browser/webshare/share_service_impl.h |
+++ b/chrome/browser/webshare/share_service_impl.h |
@@ -6,11 +6,15 @@ |
#define CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ |
#include <string> |
+#include <vector> |
#include "base/gtest_prod_util.h" |
#include "base/strings/string16.h" |
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/browser_dialogs.h" |
#include "mojo/public/cpp/bindings/interface_request.h" |
#include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" |
+#include "third_party/WebKit/public/platform/site_engagement.mojom.h" |
class GURL; |
@@ -31,6 +35,18 @@ class ShareServiceImpl : public blink::mojom::ShareService { |
private: |
FRIEND_TEST_ALL_PREFIXES(ShareServiceImplUnittest, ReplacePlaceholders); |
+ Browser* GetBrowser(); |
+ |
+ // Returns the URL template of the target identified by |target_url| |
+ std::string GetTargetTemplate(const std::string& target_url); |
+ |
+ // Virtual for testing purposes. |
+ virtual PrefService* GetPrefService(); |
+ |
+ // Returns the site engagement level of the site, |url|, with the user. |
+ // Virtual for testing purposes. |
+ virtual blink::mojom::EngagementLevel GetEngagementLevel(const GURL& url); |
+ |
// Shows the share picker dialog with |targets| as the list of applications |
// presented to the user. Passes the result to |callback|. If the user picks a |
// target, the result passed to |callback| is the manifest URL of the chosen |
@@ -43,6 +59,11 @@ class ShareServiceImpl : public blink::mojom::ShareService { |
// Virtual for testing purposes. |
virtual void OpenTargetURL(const GURL& target_url); |
+ // Returns all stored Share Targets that have a high enough engagement score |
+ // with the user. |
+ std::vector<std::pair<base::string16, GURL>> |
+ GetTargetsWithSufficientEngagement(); |
+ |
// Writes to |url_template_filled|, a copy of |url_template| with all |
// instances of "{title}", "{text}", and "{url}" replaced with |
// |title|, |text|, and |url| respectively. |