OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.enhanced_bookmarks; | 5 package org.chromium.chrome.browser.enhanced_bookmarks; |
6 | 6 |
7 import android.app.ActivityManager; | 7 import android.app.ActivityManager; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.util.LruCache; | 10 import android.util.LruCache; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 /** | 261 /** |
262 * @return Current set of known auto-filters for bookmarks. | 262 * @return Current set of known auto-filters for bookmarks. |
263 */ | 263 */ |
264 public List<String> getFilters() { | 264 public List<String> getFilters() { |
265 List<String> list = | 265 List<String> list = |
266 Arrays.asList(nativeGetFilters(mNativeEnhancedBookmarksBridge)); | 266 Arrays.asList(nativeGetFilters(mNativeEnhancedBookmarksBridge)); |
267 return list; | 267 return list; |
268 } | 268 } |
269 | 269 |
270 /** | 270 /** |
| 271 * @see |enhanced_bookmarks::GetDefaultViewMode()| |
| 272 */ |
| 273 public static int getDefaultViewMode() { |
| 274 return nativeGetDefaultViewMode(); |
| 275 } |
| 276 |
| 277 /** |
271 * @return Return the cache if it is stored in the static weak reference, or
create a new empty | 278 * @return Return the cache if it is stored in the static weak reference, or
create a new empty |
272 * one if the reference is empty. | 279 * one if the reference is empty. |
273 */ | 280 */ |
274 private static LruCache<String, Pair<String, Bitmap>> getImageCache() { | 281 private static LruCache<String, Pair<String, Bitmap>> getImageCache() { |
275 ActivityManager activityManager = ((ActivityManager) ApplicationStatus | 282 ActivityManager activityManager = ((ActivityManager) ApplicationStatus |
276 .getApplicationContext().getSystemService(Context.ACTIVITY_SERVI
CE)); | 283 .getApplicationContext().getSystemService(Context.ACTIVITY_SERVI
CE)); |
277 int maxSize = Math.min(activityManager.getMemoryClass() / 4 * 1024 * 102
4, | 284 int maxSize = Math.min(activityManager.getMemoryClass() / 4 * 1024 * 102
4, |
278 SALIENT_IMAGE_MAX_CACHE_SIZE); | 285 SALIENT_IMAGE_MAX_CACHE_SIZE); |
279 LruCache<String, Pair<String, Bitmap>> cache = sLruCache == null ? null
: sLruCache.get(); | 286 LruCache<String, Pair<String, Bitmap>> cache = sLruCache == null ? null
: sLruCache.get(); |
280 if (cache == null) { | 287 if (cache == null) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 int index, String title); | 337 int index, String title); |
331 private native void nativeMoveBookmark(long nativeEnhancedBookmarksBridge, | 338 private native void nativeMoveBookmark(long nativeEnhancedBookmarksBridge, |
332 BookmarkId bookmarkId, BookmarkId newParentId); | 339 BookmarkId bookmarkId, BookmarkId newParentId); |
333 private native BookmarkId nativeAddBookmark(long nativeEnhancedBookmarksBrid
ge, | 340 private native BookmarkId nativeAddBookmark(long nativeEnhancedBookmarksBrid
ge, |
334 BookmarkId parent, int index, String title, String url); | 341 BookmarkId parent, int index, String title, String url); |
335 private native void nativeSendSearchRequest(long nativeEnhancedBookmarksBrid
ge, String query); | 342 private native void nativeSendSearchRequest(long nativeEnhancedBookmarksBrid
ge, String query); |
336 private native void nativeSalientImageForUrl(long nativeEnhancedBookmarksBri
dge, | 343 private native void nativeSalientImageForUrl(long nativeEnhancedBookmarksBri
dge, |
337 String url, SalientImageCallback callback); | 344 String url, SalientImageCallback callback); |
338 private native void nativeFetchImageForTab(long nativeEnhancedBookmarksBridg
e, | 345 private native void nativeFetchImageForTab(long nativeEnhancedBookmarksBridg
e, |
339 WebContents webContents); | 346 WebContents webContents); |
| 347 private static native int nativeGetDefaultViewMode(); |
340 } | 348 } |
OLD | NEW |