OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_H_ | |
6 #define CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_H_ | |
7 | |
8 #include "cc/resources/ui_resource_client.h" | |
9 #include "content/public/browser/android/ui_resource_client_android.h" | |
10 #include "third_party/skia/include/core/SkBitmap.h" | |
11 | |
12 namespace content { | |
13 | |
14 class UIResourceProvider; | |
15 | |
16 class SystemUIResourceClient { | |
jdduke (slow)
2014/07/23 18:17:45
Perhaps a comment explaining why the client is nec
powei
2014/07/23 21:56:09
Done.
| |
17 public: | |
18 virtual void OnUIResourceIdChanged() = 0; | |
19 virtual ~SystemUIResourceClient() {} | |
20 }; | |
21 | |
jdduke (slow)
2014/07/23 18:17:45
Maybe a brief comment or two about the purpose for
powei
2014/07/23 21:56:08
Done.
| |
22 class SystemUIResource : public UIResourceClientAndroid { | |
23 public: | |
24 static scoped_ptr<SystemUIResource> Create(const SkBitmap& bitmap, | |
25 UIResourceProvider* provider); | |
26 | |
27 virtual ~SystemUIResource(); | |
28 | |
29 // cc::UIResourceClient implementation. | |
30 virtual cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid, | |
31 bool resource_lost) OVERRIDE; | |
32 | |
33 // content::UIResourceClientAndroid implementation. | |
34 virtual void UIResourceIsInvalid() OVERRIDE; | |
35 | |
36 cc::UIResourceId id(); | |
jdduke (slow)
2014/07/23 18:17:45
Looks like |id()| can be inline and const. I would
powei
2014/07/23 21:56:09
Done.
| |
37 void Load(); | |
jdduke (slow)
2014/07/23 18:17:45
It's not clear at first glance when |Load()| shoul
powei
2014/07/23 21:56:09
Done.
| |
38 void SetClient(SystemUIResourceClient* client); | |
jdduke (slow)
2014/07/23 18:17:45
Will the client change? Can it be set to NULL?
powei
2014/07/23 21:56:09
The client will not change. It can be set to NULL
| |
39 | |
40 private: | |
41 SystemUIResource(const SkBitmap& bitmap, UIResourceProvider* provider); | |
42 | |
43 SkBitmap bitmap_; | |
44 cc::UIResourceId id_; | |
45 UIResourceProvider* provider_; | |
46 SystemUIResourceClient* client_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(SystemUIResource); | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_H_ | |
OLD | NEW |