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

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

Issue 2644793006: Add picker view for Web Share Target. (Closed)
Patch Set: Rebase. 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_service_impl.h
diff --git a/chrome/browser/webshare/share_service_impl.h b/chrome/browser/webshare/share_service_impl.h
index 8bd381f7c97df971ee70604a7804d264e6aad7ef..bcc2a5575544da2e6dd01c0c0d4a2a1b935206f1 100644
--- a/chrome/browser/webshare/share_service_impl.h
+++ b/chrome/browser/webshare/share_service_impl.h
@@ -8,11 +8,17 @@
#include <string>
#include "base/gtest_prod_util.h"
+#include "base/strings/string16.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h"
class GURL;
+enum class SharePickerResult {
+ CANCEL,
+ SHARE
+};
+
// Desktop implementation of the ShareService Mojo service.
class ShareServiceImpl : public blink::mojom::ShareService {
public:
@@ -30,6 +36,13 @@ class ShareServiceImpl : public blink::mojom::ShareService {
private:
FRIEND_TEST_ALL_PREFIXES(ShareServiceImplUnittest, ReplacePlaceholders);
+ // Shows the share picker dialog with |targets| as the list of applications
+ // presented to the user. Passes the result to |callback|. Virtual for
+ // testing.
+ virtual void ShowPickerDialog(
+ const std::vector<base::string16>& targets,
+ const base::Callback<void(SharePickerResult)>& callback);
+
// Opens a new tab and navigates to |target_url|.
// Virtual for testing purposes.
virtual void OpenTargetURL(const GURL& target_url);
@@ -48,6 +61,12 @@ class ShareServiceImpl : public blink::mojom::ShareService {
const GURL& share_url,
std::string* url_template_filled);
+ void OnPickerClosed(const std::string& title,
+ const std::string& text,
+ const GURL& share_url,
+ const ShareCallback& callback,
+ SharePickerResult result);
+
DISALLOW_COPY_AND_ASSIGN(ShareServiceImpl);
};
« no previous file with comments | « chrome/browser/ui/views/webshare/webshare_target_picker_view.cc ('k') | chrome/browser/webshare/share_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698