OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 FrameViewAutoSizeInfo_h | 5 #ifndef FrameViewAutoSizeInfo_h |
6 #define FrameViewAutoSizeInfo_h | 6 #define FrameViewAutoSizeInfo_h |
7 | 7 |
8 #include "platform/geometry/IntSize.h" | 8 #include "platform/geometry/IntSize.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "wtf/FastAllocBase.h" | 10 #include "wtf/FastAllocBase.h" |
11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
12 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class FrameView; | 16 class FrameView; |
17 | 17 |
18 class FrameViewAutoSizeInfo final : public NoBaseWillBeGarbageCollected<FrameVie
wAutoSizeInfo> { | 18 class FrameViewAutoSizeInfo final : public NoBaseWillBeGarbageCollected<FrameVie
wAutoSizeInfo> { |
19 WTF_MAKE_NONCOPYABLE(FrameViewAutoSizeInfo); | 19 WTF_MAKE_NONCOPYABLE(FrameViewAutoSizeInfo); |
20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 21 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameViewAutoSizeInfo); |
21 public: | 22 public: |
22 static PassOwnPtrWillBeRawPtr<FrameViewAutoSizeInfo> create(FrameView* frame
View) | 23 static PassOwnPtrWillBeRawPtr<FrameViewAutoSizeInfo> create(FrameView* frame
View) |
23 { | 24 { |
24 return adoptPtrWillBeNoop(new FrameViewAutoSizeInfo(frameView)); | 25 return adoptPtrWillBeNoop(new FrameViewAutoSizeInfo(frameView)); |
25 } | 26 } |
26 | 27 |
27 void configureAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); | 28 void configureAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); |
28 void autoSizeIfNeeded(); | 29 void autoSizeIfNeeded(); |
29 | 30 |
| 31 DECLARE_TRACE(); |
| 32 |
30 private: | 33 private: |
31 explicit FrameViewAutoSizeInfo(FrameView*); | 34 explicit FrameViewAutoSizeInfo(FrameView*); |
32 | 35 |
33 FrameView* m_frameView; | 36 RawPtrWillBeMember<FrameView> m_frameView; |
34 | 37 |
35 // The lower bound on the size when autosizing. | 38 // The lower bound on the size when autosizing. |
36 IntSize m_minAutoSize; | 39 IntSize m_minAutoSize; |
37 // The upper bound on the size when autosizing. | 40 // The upper bound on the size when autosizing. |
38 IntSize m_maxAutoSize; | 41 IntSize m_maxAutoSize; |
39 | 42 |
40 bool m_inAutoSize; | 43 bool m_inAutoSize; |
41 // True if autosize has been run since m_shouldAutoSize was set. | 44 // True if autosize has been run since m_shouldAutoSize was set. |
42 bool m_didRunAutosize; | 45 bool m_didRunAutosize; |
43 }; | 46 }; |
44 | 47 |
45 } // namespace blink | 48 } // namespace blink |
46 | 49 |
47 #endif // FrameViewAutoSizeInfo_h | 50 #endif // FrameViewAutoSizeInfo_h |
OLD | NEW |