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 30 matching lines...) Expand all Loading... |
41 void OnBoundsChanged(const gfx::Rect& old_bounds, | 41 void OnBoundsChanged(const gfx::Rect& old_bounds, |
42 const gfx::Rect& new_bounds) override; | 42 const gfx::Rect& new_bounds) override; |
43 ui::TextInputClient* GetFocusedTextInputClient() override; | 43 ui::TextInputClient* GetFocusedTextInputClient() override; |
44 gfx::NativeCursor GetCursor(const gfx::Point& point) override; | 44 gfx::NativeCursor GetCursor(const gfx::Point& point) override; |
45 int GetNonClientComponent(const gfx::Point& point) const override; | 45 int GetNonClientComponent(const gfx::Point& point) const override; |
46 bool ShouldDescendIntoChildForEventHandling( | 46 bool ShouldDescendIntoChildForEventHandling( |
47 aura::Window* child, | 47 aura::Window* child, |
48 const gfx::Point& location) override; | 48 const gfx::Point& location) override; |
49 bool CanFocus() override; | 49 bool CanFocus() override; |
50 void OnCaptureLost() override; | 50 void OnCaptureLost() override; |
51 void OnPaint(gfx::Canvas* canvas) override; | 51 void OnPaint(const ui::PaintContext& context) override; |
52 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | 52 void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
53 void OnWindowDestroying(aura::Window* window) override; | 53 void OnWindowDestroying(aura::Window* window) override; |
54 void OnWindowDestroyed(aura::Window* window) override; | 54 void OnWindowDestroyed(aura::Window* window) override; |
55 void OnWindowTargetVisibilityChanged(bool visible) override; | 55 void OnWindowTargetVisibilityChanged(bool visible) override; |
56 bool HasHitTestMask() const override; | 56 bool HasHitTestMask() const override; |
57 void GetHitTestMask(gfx::Path* mask) const override; | 57 void GetHitTestMask(gfx::Path* mask) const override; |
58 | 58 |
59 protected: | 59 protected: |
60 SkColor background_color_; | 60 SkColor background_color_; |
61 gfx::Image image_; | 61 gfx::Image image_; |
62 gfx::Vector2d offset_; | 62 gfx::Vector2d offset_; |
63 | 63 |
64 gfx::Size window_size_; | 64 gfx::Size window_size_; |
65 | 65 |
66 // Keeps track of whether the window size matches the image size or not. If | 66 // Keeps track of whether the window size matches the image size or not. If |
67 // the image size is smaller than the window size, then the delegate fills the | 67 // the image size is smaller than the window size, then the delegate fills the |
68 // missing regions with |background_color_| (defult is white). | 68 // missing regions with |background_color_| (defult is white). |
69 bool size_mismatch_; | 69 bool size_mismatch_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(ImageWindowDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(ImageWindowDelegate); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace aura_extra | 74 } // namespace aura_extra |
75 | 75 |
76 #endif // UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ | 76 #endif // UI_AURA_EXTRA_IMAGE_WINDOW_DELEGATE_H_ |
OLD | NEW |