OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ |
6 #define UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/aura/window_delegate.h" | 9 #include "ui/aura/window_delegate.h" |
10 #include "ui/aura_extra/aura_extra_export.h" | 10 #include "ui/aura_extra/aura_extra_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 ImageWindowDelegate(); | 26 ImageWindowDelegate(); |
27 | 27 |
28 void SetImage(const gfx::Image& image); | 28 void SetImage(const gfx::Image& image); |
29 | 29 |
30 void set_background_color(SkColor color) { background_color_ = color; } | 30 void set_background_color(SkColor color) { background_color_ = color; } |
31 void set_image_offset(gfx::Vector2d offset) { offset_ = offset; } | 31 void set_image_offset(gfx::Vector2d offset) { offset_ = offset; } |
32 | 32 |
33 bool has_image() const { return !image_.IsEmpty(); } | 33 bool has_image() const { return !image_.IsEmpty(); } |
34 | 34 |
| 35 // TODO this method is an overkill, store image in ONO. |
| 36 gfx::Image Image() const { return image_; } |
| 37 |
35 protected: | 38 protected: |
36 ~ImageWindowDelegate() override; | 39 ~ImageWindowDelegate() override; |
37 | 40 |
38 // Overridden from aura::WindowDelegate: | 41 // Overridden from aura::WindowDelegate: |
39 gfx::Size GetMinimumSize() const override; | 42 gfx::Size GetMinimumSize() const override; |
40 gfx::Size GetMaximumSize() const override; | 43 gfx::Size GetMaximumSize() const override; |
41 void OnBoundsChanged(const gfx::Rect& old_bounds, | 44 void OnBoundsChanged(const gfx::Rect& old_bounds, |
42 const gfx::Rect& new_bounds) override; | 45 const gfx::Rect& new_bounds) override; |
43 ui::TextInputClient* GetFocusedTextInputClient() override; | 46 ui::TextInputClient* GetFocusedTextInputClient() override; |
44 gfx::NativeCursor GetCursor(const gfx::Point& point) override; | 47 gfx::NativeCursor GetCursor(const gfx::Point& point) override; |
(...skipping 22 matching lines...) Expand all Loading... |
67 // the image size is smaller than the window size, then the delegate fills the | 70 // the image size is smaller than the window size, then the delegate fills the |
68 // missing regions with |background_color_| (defult is white). | 71 // missing regions with |background_color_| (defult is white). |
69 bool size_mismatch_; | 72 bool size_mismatch_; |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(ImageWindowDelegate); | 74 DISALLOW_COPY_AND_ASSIGN(ImageWindowDelegate); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace aura_extra | 77 } // namespace aura_extra |
75 | 78 |
76 #endif // UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ | 79 #endif // UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ |
OLD | NEW |