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

Unified Diff: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java

Issue 1164973003: Add initial support for runtime permissions in android M. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Appease findbugs Created 5 years, 6 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
« no previous file with comments | « ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698