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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java

Issue 489053003: Use content URI to upload photos taken by camera (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add thread check Created 6 years, 4 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/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..75763894c4609f04028158ab56114c41c9c9665c
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/FileProviderHelper.java
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser;
+
+import android.content.Context;
+import android.net.Uri;
+import android.support.v4.content.FileProvider;
+
+import org.chromium.base.ContentUriUtils;
+
+import java.io.File;
+
+/**
+ * Utilities for translating a file into content URI.
+ */
+public class FileProviderHelper implements ContentUriUtils.FileProviderUtil {
+ // Keep this variable in sync with the value defined in file_paths.xml.
+ private static final String API_AUTHORITY_SUFFIX = ".FileProvider";
+
+ @Override
+ public Uri getContentUriFromFile(Context context, File file) {
+ return FileProvider.getUriForFile(context,
+ context.getPackageName() + API_AUTHORITY_SUFFIX, file);
+ }
+}
« no previous file with comments | « base/android/java/src/org/chromium/base/ContentUriUtils.java ('k') | chrome/android/shell/java/AndroidManifest.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698