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

Side by Side Diff: base/android/java/PathUtils.java

Issue 9443018: Upstream Android's PathUtils implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chromeview.base;
John Grabowski 2012/02/26 08:25:58 I don't think org.chromium.chromeview makes sense
Peter Beverloo 2012/02/29 15:40:22 Done in the thread. It's org.chromium.base now.
6
7 import android.content.Context;
8 import android.os.Environment;
9
10 import org.chromium.chromeview.base.CalledByNative;
11
12 import java.io.File;
13
14 /**
15 * This class provides the path related methods for the native library.
16 */
17 class PathUtils {
18
19 /**
20 * @return the private directory that used to store application data.
21 */
22 @CalledByNative
23 public static String getDataDirectory(Context appContext) {
24 // TODO(beverloo) base/ should not know about "chrome": http://b/6057342
John Grabowski 2012/02/26 08:25:58 I think we should try a little harder to not viola
klobag.chromium 2012/02/27 21:38:59 I actually don't think this violates the layering.
25 return appContext.getDir("chrome", Context.MODE_PRIVATE).getPath();
26 }
27
28 /**
29 * @return the cache directory.
30 */
31 @CalledByNative
32 public static String getCacheDirectory(Context appContext) {
33 return appContext.getCacheDir().getPath();
34 }
35
36 /**
37 * @return the public downloads directory.
38 */
39 @CalledByNative
40 public static String getDownloadsDirectory(Context appContext) {
41 return Environment.getExternalStoragePublicDirectory(
42 Environment.DIRECTORY_DOWNLOADS).getPath();
43 }
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698