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

Unified Diff: third_party/WebKit/public/platform/modules/webshare/webshare.mojom

Issue 2703333002: Web Share: Refactor Mojo interface to now return an enum error. (Closed)
Patch Set: 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: third_party/WebKit/public/platform/modules/webshare/webshare.mojom
diff --git a/third_party/WebKit/public/platform/modules/webshare/webshare.mojom b/third_party/WebKit/public/platform/modules/webshare/webshare.mojom
index 71512f8308e0950d11d0ddbf042b257d3d9b1e6a..80b3db664e96d2a0db9431bfba3ed07812005cac 100644
--- a/third_party/WebKit/public/platform/modules/webshare/webshare.mojom
+++ b/third_party/WebKit/public/platform/modules/webshare/webshare.mojom
@@ -7,11 +7,21 @@ module blink.mojom;
import "url/mojo/url.mojom";
+enum ShareError {
+ // Share successful.
+ OK,
+ // Something went wrong in the implementation.
+ INTERNAL_ERROR,
+ // Share was canceled by user.
+ CANCELED,
+ // The URL template was invalid (e.g., mismatching braces).
+ // TODO(mgiuca): This error should not be possible at share time, because
+ // targets with invalid templates should not be chooseable.
+ // https://crbug.com/694380
+ INVALID_TEMPLATE,
Sam McNally 2017/02/21 23:02:40 With the impending removal of this error, can we s
Matt Giuca 2017/02/23 04:18:37 Done.
+};
+
interface ShareService {
- // The web contents has requested to send a share text action. Returns null on
- // success, or an error message on failure.
- // TODO(mgiuca): Return an error enum, instead of a string (so the actual
- // error messages are generated in a single place, rather than many service
- // handlers).
- Share(string title, string text, url.mojom.Url url) => (string? error);
+ // The web contents has requested to send a share text action.
+ Share(string title, string text, url.mojom.Url url) => (ShareError error);
};

Powered by Google App Engine
This is Rietveld 408576698