| Index: ui/aura/image_window_delegate.h
|
| diff --git a/content/browser/web_contents/aura/image_window_delegate.h b/ui/aura/image_window_delegate.h
|
| similarity index 66%
|
| rename from content/browser/web_contents/aura/image_window_delegate.h
|
| rename to ui/aura/image_window_delegate.h
|
| index a36110d40c25501d56c26122d1194eba5187f4c4..298756c6570b9a3f802f497ce51d583667d58696 100644
|
| --- a/content/browser/web_contents/aura/image_window_delegate.h
|
| +++ b/ui/aura/image_window_delegate.h
|
| @@ -2,23 +2,32 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_IMAGE_WINDOW_DELEGATE_H_
|
| -#define CONTENT_BROWSER_WEB_CONTENTS_AURA_IMAGE_WINDOW_DELEGATE_H_
|
| +#ifndef UI_AURA_IMAGE_WINDOW_DELEGATE_H_
|
| +#define UI_AURA_IMAGE_WINDOW_DELEGATE_H_
|
|
|
| -#include "content/common/content_export.h"
|
| +#include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/aura/window_delegate.h"
|
| #include "ui/gfx/geometry/size.h"
|
| +#include "ui/gfx/geometry/vector2d.h"
|
| #include "ui/gfx/image/image.h"
|
|
|
| -namespace content {
|
| +namespace aura {
|
|
|
| -// An ImageWindowDelegate paints an image for a Window. The delegate destroys
|
| -// itself when the Window is destroyed. The delegate does not consume any event.
|
| -class CONTENT_EXPORT ImageWindowDelegate : public aura::WindowDelegate {
|
| +// An ImageWindowDelegate paints an image for a Window, possibly also filling
|
| +// the window with a specified backround color. By default the delegate destroys
|
| +// itself when the Window is destroyed. Use |SetSelfDestroy| to override. The
|
| +// delegate does not consume any event.
|
| +class AURA_EXPORT ImageWindowDelegate : public aura::WindowDelegate {
|
| public:
|
| ImageWindowDelegate();
|
|
|
| + void SetBackgroundColor(SkColor color);
|
| void SetImage(const gfx::Image& image);
|
| + void SetImageOffset(gfx::Vector2d offset);
|
| +
|
| + // Controls whether the delegate destroys itself when its window is destroyed.
|
| + void SetSelfDestroy(bool self_destroy);
|
| +
|
| bool has_image() const { return !image_.IsEmpty(); }
|
|
|
| protected:
|
| @@ -45,7 +54,11 @@ class CONTENT_EXPORT ImageWindowDelegate : public aura::WindowDelegate {
|
| void GetHitTestMask(gfx::Path* mask) const override;
|
|
|
| protected:
|
| + SkColor background_color_;
|
| gfx::Image image_;
|
| + gfx::Vector2d offset_;
|
| + bool self_destroy_;
|
| +
|
| gfx::Size window_size_;
|
|
|
| // Keeps track of whether the window size matches the image size or not. If
|
| @@ -56,6 +69,6 @@ class CONTENT_EXPORT ImageWindowDelegate : public aura::WindowDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(ImageWindowDelegate);
|
| };
|
|
|
| -} // namespace content
|
| +} // namespace aura
|
|
|
| -#endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_IMAGE_WINDOW_DELEGATE_H_
|
| +#endif // UI_AURA_IMAGE_WINDOW_DELEGATE_H_
|
|
|