Chromium Code Reviews| 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 63a18aa7c569ee70b9a07eb23d13c7e84be4a327..3f696af07ae9be8627deea0a6495ab8c75cdec01 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,13 @@ class ShareServiceImpl : public blink::mojom::ShareService { |
| private: |
| FRIEND_TEST_ALL_PREFIXES(ShareServiceImplUnittest, ReplacePlaceholders); |
| + Browser* GetBrowser(); |
| + std::string GetTargetTemplate(const std::string& target_url); |
|
Matt Giuca
2017/02/03 02:40:24
Document this.
Separate out these functions by sp
constantina
2017/02/08 23:25:16
Done.
|
| + // Virtual for testing purposes. |
| + virtual PrefService* GetPrefService(); |
| + // Virtual for testing purposes. |
| + virtual blink::mojom::EngagementLevel GetEngagementLevel(const GURL& url); |
|
Matt Giuca
2017/02/03 02:40:24
Properly document this.
constantina
2017/02/08 23:25:16
Done.
|
| + |
| // 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 +54,10 @@ 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::string> 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. |