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

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

Issue 2667803002: Picker takes a vector of pairs, and passes back the user chosen target. (Closed)
Patch Set: Dynamically enable/disable button Created 3 years, 10 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 bcc2a5575544da2e6dd01c0c0d4a2a1b935206f1..3bc47deae3f5b84fee5fe3b2ca1e73cfcedde381 100644
--- a/chrome/browser/webshare/share_service_impl.h
+++ b/chrome/browser/webshare/share_service_impl.h
@@ -14,11 +14,6 @@
class GURL;
-enum class SharePickerResult {
- CANCEL,
- SHARE
-};
-
// Desktop implementation of the ShareService Mojo service.
class ShareServiceImpl : public blink::mojom::ShareService {
public:
@@ -37,11 +32,12 @@ class ShareServiceImpl : public blink::mojom::ShareService {
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.
+ // 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
+ // target, or is null if the user cancelled the share. Virtual for testing.
virtual void ShowPickerDialog(
- const std::vector<base::string16>& targets,
- const base::Callback<void(SharePickerResult)>& callback);
+ const std::vector<std::pair<base::string16, GURL>>& targets,
+ const base::Callback<void(base::Optional<std::string>)>& callback);
// Opens a new tab and navigates to |target_url|.
// Virtual for testing purposes.
@@ -65,7 +61,7 @@ class ShareServiceImpl : public blink::mojom::ShareService {
const std::string& text,
const GURL& share_url,
const ShareCallback& callback,
- SharePickerResult result);
+ base::Optional<std::string> 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