Index: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
index 84a34990d35a0c5df5375c3de7a071557f31fdac..d0dde3ddbb5c4bf27ae6327e8ad784be4c3f8b2f 100644 |
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
@@ -214,6 +214,16 @@ public class WindowAndroid { |
} |
/** |
+ * Requests the specified permissions are granted for further use. |
+ * @param permissions The list of permissions to request access to. |
+ * @param callback The callback to be notified whether the permissions were granted. |
+ */ |
+ public void requestPermissions(String[] permissions, PermissionCallback callback) { |
+ Log.w(TAG, "Cannot request permissions as the context is not an Activity"); |
+ assert false : "Failed to request permissions using a WindowAndroid without an Activity"; |
+ } |
+ |
+ /** |
* Displays an error message with a provided error message string. |
* @param error The error message string to be displayed. |
*/ |
@@ -305,17 +315,6 @@ public class WindowAndroid { |
nativeOnActivityResumed(mNativeWindowAndroid); |
} |
- /** |
- * Responds to the intent result if the intent was created by the native window. |
- * @param requestCode Request code of the requested intent. |
- * @param resultCode Result code of the requested intent. |
- * @param data The data returned by the intent. |
- * @return Boolean value of whether the intent was started by the native window. |
- */ |
- public boolean onActivityResult(int requestCode, int resultCode, Intent data) { |
- return false; |
- } |
- |
@CalledByNative |
private void requestVSyncUpdate() { |
mVSyncMonitor.requestUpdate(); |
@@ -337,6 +336,23 @@ public class WindowAndroid { |
} |
/** |
+ * Callback for permission requests. |
+ */ |
+ public interface PermissionCallback { |
+ /** |
+ * Called upon completing a permission request. |
+ * @param permissions The list of permissions in the result. |
+ * @param grantResults Whether the permissions were granted. |
+ */ |
+ void onRequestPermissionsResult(String[] permissions, int[] grantResults); |
+ |
+ /** |
+ * Called when a permission request has been aborted. |
+ */ |
+ void onRequestPermissionAborted(); |
+ } |
+ |
+ /** |
* Tests that an activity is available to handle the passed in intent. |
* @param intent The intent to check. |
* @return True if an activity is available to process this intent when started, meaning that |