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

Unified Diff: content/browser/android/ui_resource_android_impl.h

Issue 731133002: Upstream ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add generated enum class to BUILD.gn 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/browser/android/ui_resource_android_impl.h
diff --git a/content/browser/android/ui_resource_android_impl.h b/content/browser/android/ui_resource_android_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..f0b3df452f6ddacc88c17b3923696cc7c495c583
--- /dev/null
+++ b/content/browser/android/ui_resource_android_impl.h
@@ -0,0 +1,52 @@
+// 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_UI_RESOURCE_ANDROID_IMPL_H_
+#define CONTENT_BROWSER_ANDROID_UI_RESOURCE_ANDROID_IMPL_H_
+
+#include <jni.h>
+
+#include "base/basictypes.h"
+#include "cc/resources/ui_resource_bitmap.h"
+#include "content/public/browser/android/ui_resource_android.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/android/java_bitmap.h"
+
+namespace content {
+
+class UIResourceAndroidImpl : public UIResourceAndroid {
+ public:
+ static scoped_ptr<UIResourceAndroidImpl> CreateFromJavaBitmap(
+ content::UIResourceProvider* provider,
+ jobject bitmap_object);
+
+ static scoped_ptr<UIResourceAndroidImpl> CreateFromJavaBitmap(
+ content::UIResourceProvider* provider,
+ const gfx::JavaBitmap& java_bitmap);
+
+ virtual ~UIResourceAndroidImpl();
+
+ // cc::UIResourceClient implementation.
+ cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid,
+ bool resource_lost) override;
+
+ // content::UIResourceClientAndroid implementation.
+ void UIResourceIsInvalid() override;
+
+ cc::UIResourceId id() override;
+
+ private:
+ UIResourceAndroidImpl(content::UIResourceProvider* provider,
+ const SkBitmap& skbitmap);
+
+ content::UIResourceProvider* provider_;
+ SkBitmap bitmap_;
+ cc::UIResourceId id_;
+
+ DISALLOW_COPY_AND_ASSIGN(UIResourceAndroidImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_UI_RESOURCE_ANDROID_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698