OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SKY_ENGINE_CORE_VIEW_VIEW_H_ | 5 #ifndef SKY_ENGINE_CORE_VIEW_VIEW_H_ |
6 #define SKY_ENGINE_CORE_VIEW_VIEW_H_ | 6 #define SKY_ENGINE_CORE_VIEW_VIEW_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "sky/engine/core/html/VoidCallback.h" | 10 #include "sky/engine/core/html/VoidCallback.h" |
11 #include "sky/engine/core/painting/Picture.h" | 11 #include "sky/engine/core/painting/Picture.h" |
12 #include "sky/engine/core/view/EventCallback.h" | 12 #include "sky/engine/core/view/EventCallback.h" |
13 #include "sky/engine/core/view/FrameCallback.h" | 13 #include "sky/engine/core/view/FrameCallback.h" |
14 #include "sky/engine/public/platform/sky_display_metrics.h" | 14 #include "sky/engine/public/platform/sky_display_metrics.h" |
15 #include "sky/engine/tonic/dart_wrappable.h" | 15 #include "sky/engine/tonic/dart_wrappable.h" |
16 #include "sky/engine/wtf/PassRefPtr.h" | 16 #include "sky/engine/wtf/PassRefPtr.h" |
17 #include "sky/engine/wtf/RefCounted.h" | 17 #include "sky/engine/wtf/RefCounted.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class View : public RefCounted<View>, public DartWrappable { | 21 class View : public RefCounted<View>, public DartWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
23 public: | 23 public: |
24 ~View() override; | 24 ~View() override; |
25 static PassRefPtr<View> create(const base::Closure& scheduleFrameCallback); | 25 static PassRefPtr<View> create(const base::Closure& scheduleFrameCallback); |
26 | 26 |
27 double devicePixelRatio() const { return m_displayMetrics.device_pixel_ratio
; } | 27 double devicePixelRatio() const { return m_displayMetrics.device_pixel_ratio
; } |
| 28 |
| 29 double paddingTop() const { return m_displayMetrics.padding_top; } |
| 30 double paddingRight() const { return m_displayMetrics.padding_right; } |
| 31 double paddingBottom() const { return m_displayMetrics.padding_bottom; } |
| 32 double paddingLeft() const { return m_displayMetrics.padding_left; } |
| 33 |
28 double width() const; | 34 double width() const; |
29 double height() const; | 35 double height() const; |
30 | 36 |
31 Picture* picture() const { return m_picture.get(); } | 37 Picture* picture() const { return m_picture.get(); } |
32 void setPicture(Picture* picture) { m_picture = picture; } | 38 void setPicture(Picture* picture) { m_picture = picture; } |
33 | 39 |
34 void setEventCallback(PassOwnPtr<EventCallback> callback); | 40 void setEventCallback(PassOwnPtr<EventCallback> callback); |
35 | 41 |
36 void setMetricsChangedCallback(PassOwnPtr<VoidCallback> callback); | 42 void setMetricsChangedCallback(PassOwnPtr<VoidCallback> callback); |
37 | 43 |
(...skipping 11 matching lines...) Expand all Loading... |
49 SkyDisplayMetrics m_displayMetrics; | 55 SkyDisplayMetrics m_displayMetrics; |
50 OwnPtr<EventCallback> m_eventCallback; | 56 OwnPtr<EventCallback> m_eventCallback; |
51 OwnPtr<VoidCallback> m_metricsChangedCallback; | 57 OwnPtr<VoidCallback> m_metricsChangedCallback; |
52 OwnPtr<FrameCallback> m_frameCallback; | 58 OwnPtr<FrameCallback> m_frameCallback; |
53 RefPtr<Picture> m_picture; | 59 RefPtr<Picture> m_picture; |
54 }; | 60 }; |
55 | 61 |
56 } // namespace blink | 62 } // namespace blink |
57 | 63 |
58 #endif // SKY_ENGINE_CORE_VIEW_VIEW_H_ | 64 #endif // SKY_ENGINE_CORE_VIEW_VIEW_H_ |
OLD | NEW |