Chromium Code Reviews| Index: content/browser/android/system_ui_resource.h |
| diff --git a/content/browser/android/system_ui_resource.h b/content/browser/android/system_ui_resource.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dbb64e258a16128621a5e0846d8e50961555dc33 |
| --- /dev/null |
| +++ b/content/browser/android/system_ui_resource.h |
| @@ -0,0 +1,53 @@ |
| +// 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_SYSTEM_UI_RESOURCE_H_ |
| +#define CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_H_ |
| + |
| +#include "cc/resources/ui_resource_client.h" |
| +#include "content/public/browser/android/ui_resource_client_android.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| + |
| +namespace content { |
| + |
| +class UIResourceProvider; |
| + |
| +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.
|
| + public: |
| + virtual void OnUIResourceIdChanged() = 0; |
| + virtual ~SystemUIResourceClient() {} |
| +}; |
| + |
|
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.
|
| +class SystemUIResource : public UIResourceClientAndroid { |
| + public: |
| + static scoped_ptr<SystemUIResource> Create(const SkBitmap& bitmap, |
| + UIResourceProvider* provider); |
| + |
| + virtual ~SystemUIResource(); |
| + |
| + // cc::UIResourceClient implementation. |
| + virtual cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid, |
| + bool resource_lost) OVERRIDE; |
| + |
| + // content::UIResourceClientAndroid implementation. |
| + virtual void UIResourceIsInvalid() OVERRIDE; |
| + |
| + 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.
|
| + 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.
|
| + 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
|
| + |
| + private: |
| + SystemUIResource(const SkBitmap& bitmap, UIResourceProvider* provider); |
| + |
| + SkBitmap bitmap_; |
| + cc::UIResourceId id_; |
| + UIResourceProvider* provider_; |
| + SystemUIResourceClient* client_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SystemUIResource); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_H_ |