Roll src/third_party/WebKit 66ff0f0:3ba1789 (svn 186751:186755)
[chromium-blink-merge.git] / ui / android / resources / ui_resource_android.h
blobc18c0d73ee22075e07ec79dcd77a3b66a673a159
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
3 // found in the LICENSE file.
5 #ifndef UI_ANDROID_RESOURCES_UI_RESOURCE_ANDROID_H_
6 #define UI_ANDROID_RESOURCES_UI_RESOURCE_ANDROID_H_
8 #include "base/basictypes.h"
9 #include "cc/resources/ui_resource_bitmap.h"
10 #include "content/public/browser/android/ui_resource_client_android.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "ui/android/resources/ui_resource_android.h"
13 #include "ui/android/ui_android_export.h"
14 #include "ui/gfx/android/java_bitmap.h"
16 namespace ui {
18 class UI_ANDROID_EXPORT UIResourceAndroid
19 : public content::UIResourceClientAndroid {
20 public:
21 static scoped_ptr<UIResourceAndroid> CreateFromJavaBitmap(
22 content::UIResourceProvider* provider,
23 const gfx::JavaBitmap& java_bitmap);
25 ~UIResourceAndroid() override;
27 // cc::UIResourceClient implementation.
28 cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid,
29 bool resource_lost) override;
31 // UIResourceClientAndroid implementation.
32 void UIResourceIsInvalid() override;
34 cc::UIResourceId id();
36 private:
37 UIResourceAndroid(content::UIResourceProvider* provider,
38 const SkBitmap& skbitmap);
40 content::UIResourceProvider* provider_;
41 SkBitmap bitmap_;
42 cc::UIResourceId id_;
44 DISALLOW_COPY_AND_ASSIGN(UIResourceAndroid);
47 } // namespace ui
49 #endif // UI_ANDROID_RESOURCES_UI_RESOURCE_ANDROID_H_