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

Unified Diff: content/public/browser/android/resource_manager.h

Issue 731133002: Upstream ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply David's comments Created 6 years, 1 month 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: content/public/browser/android/resource_manager.h
diff --git a/content/public/browser/android/resource_manager.h b/content/public/browser/android/resource_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..f842511382d24573cce44f95f1023f517168cb51
--- /dev/null
+++ b/content/public/browser/android/resource_manager.h
@@ -0,0 +1,63 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_
+#define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_
+
+#include <android/bitmap.h>
jdduke (slow) 2014/11/19 00:09:16 Can we get away with not including these headers?
Jaekyun Seok (inactive) 2014/11/19 02:41:38 Done.
+#include <jni.h>
+#include "base/android/jni_android.h"
+#include "base/id_map.h"
jdduke (slow) 2014/11/19 00:09:16 id_map.h looks unused.
Jaekyun Seok (inactive) 2014/11/19 02:41:38 Done.
+#include "cc/resources/ui_resource_client.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/android/ui_resource_android.h"
jdduke (slow) 2014/11/19 00:09:16 Also, UIResourceAndroid is forward declared, so do
Jaekyun Seok (inactive) 2014/11/19 02:41:38 Done.
+#include "third_party/skia/include/core/SkBitmap.h"
jdduke (slow) 2014/11/19 00:09:16 I don't see SkBitmap used here.
Jaekyun Seok (inactive) 2014/11/19 02:41:38 Done.
+#include "ui/gfx/geometry/insets_f.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace content {
+
+class UIResourceAndroid;
+
+// A Java counterpart will be generated for this enum.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.resources
+enum ResourceKind {
+ RESOURCE_KIND_STATIC = 0,
+ RESOURCE_KIND_DYNAMIC,
+ RESOURCE_KIND_DYNAMIC_BITMAP,
+ RESOURCE_KIND_SYSTEM,
+
+ RESOURCE_KIND_COUNT,
+ RESOURCE_KIND_FIRST = RESOURCE_KIND_STATIC,
+ RESOURCE_KIND_LAST = RESOURCE_KIND_SYSTEM,
+};
+
+class CONTENT_EXPORT ResourceManager {
+ public:
+ struct Resource {
+ public:
+ Resource();
+ ~Resource();
+ gfx::Rect Border(const gfx::Size& bounds);
+ gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale);
+
+ scoped_ptr<UIResourceAndroid> ui_resource;
+ gfx::Size size;
+ gfx::Rect padding;
+ gfx::Rect aperture;
+ };
+
+ virtual ~ResourceManager() {}
+
+ virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject(
+ JNIEnv* env) = 0;
+
+ virtual ResourceManager::Resource* GetResource(ResourceKind res_type,
+ int res_id) = 0;
+ virtual void PreloadResource(ResourceKind res_type, int res_id) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698