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

Unified Diff: ui/android/resources/resource_manager.h

Issue 1337703002: [Contextual Search] Add support for crushed sprites and animate the search provider icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Very small changes from last pedrosimonneti@ review Created 5 years, 2 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: ui/android/resources/resource_manager.h
diff --git a/ui/android/resources/resource_manager.h b/ui/android/resources/resource_manager.h
index add8cda452f48082e0807ae8049463866335f28e..2dfe4c895e99f59f0a247ad82e432226b406f295 100644
--- a/ui/android/resources/resource_manager.h
+++ b/ui/android/resources/resource_manager.h
@@ -8,6 +8,7 @@
#include "base/android/jni_android.h"
#include "base/memory/scoped_ptr.h"
#include "cc/resources/scoped_ui_resource.h"
+#include "ui/android/resources/crushed_sprite_resource.h"
#include "ui/android/ui_android_export.h"
#include "ui/gfx/geometry/insets_f.h"
#include "ui/gfx/geometry/rect.h"
@@ -24,10 +25,11 @@ enum AndroidResourceType {
ANDROID_RESOURCE_TYPE_DYNAMIC,
ANDROID_RESOURCE_TYPE_DYNAMIC_BITMAP,
ANDROID_RESOURCE_TYPE_SYSTEM,
+ ANDROID_RESOURCE_TYPE_CRUSHED_SPRITE,
ANDROID_RESOURCE_TYPE_COUNT,
ANDROID_RESOURCE_TYPE_FIRST = ANDROID_RESOURCE_TYPE_STATIC,
- ANDROID_RESOURCE_TYPE_LAST = ANDROID_RESOURCE_TYPE_SYSTEM,
+ ANDROID_RESOURCE_TYPE_LAST = ANDROID_RESOURCE_TYPE_CRUSHED_SPRITE,
};
// The ResourceManager serves as a cache for resources obtained through Android
@@ -61,6 +63,14 @@ class UI_ANDROID_EXPORT ResourceManager {
// |res_id|, if it has not yet been loaded.
virtual void PreloadResource(AndroidResourceType res_type, int res_id) = 0;
+ // Return a handle to the CrushedSpriteResource specified by |bitmap_res_id|
+ // and |metadata_res_id|. If the resource has not been loaded, loading will be
+ // performed synchronously, blocking until the load completes. If load fails,
+ // a null handle will be returned and it is up to the caller to react
+ // appropriately.
+ virtual CrushedSpriteResource* GetCrushedSpriteResource(
+ int bitmap_res_id, int metadata_res_id) = 0;
+
// Convenience wrapper method.
cc::UIResourceId GetUIResourceId(AndroidResourceType res_type, int res_id) {
Resource* resource = GetResource(res_type, res_id);

Powered by Google App Engine
This is Rietveld 408576698