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 #include "config.h" | 5 #include "config.h" |
6 #include "core/frame/FrameViewAutoSizeInfo.h" | 6 #include "core/frame/FrameViewAutoSizeInfo.h" |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 FrameViewAutoSizeInfo::FrameViewAutoSizeInfo(FrameView* view) | 15 FrameViewAutoSizeInfo::FrameViewAutoSizeInfo(FrameView* view) |
16 : m_frameView(view) | 16 : m_frameView(view) |
17 , m_inAutoSize(false) | 17 , m_inAutoSize(false) |
18 , m_didRunAutosize(false) | 18 , m_didRunAutosize(false) |
19 { | 19 { |
20 ASSERT(m_frameView); | 20 ASSERT(m_frameView); |
21 } | 21 } |
22 | 22 |
| 23 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameViewAutoSizeInfo); |
| 24 |
| 25 DEFINE_TRACE(FrameViewAutoSizeInfo) |
| 26 { |
| 27 visitor->trace(m_frameView); |
| 28 } |
| 29 |
23 void FrameViewAutoSizeInfo::configureAutoSizeMode(const IntSize& minSize, const
IntSize& maxSize) | 30 void FrameViewAutoSizeInfo::configureAutoSizeMode(const IntSize& minSize, const
IntSize& maxSize) |
24 { | 31 { |
25 ASSERT(!minSize.isEmpty()); | 32 ASSERT(!minSize.isEmpty()); |
26 ASSERT(minSize.width() <= maxSize.width()); | 33 ASSERT(minSize.width() <= maxSize.width()); |
27 ASSERT(minSize.height() <= maxSize.height()); | 34 ASSERT(minSize.height() <= maxSize.height()); |
28 | 35 |
29 if (m_minAutoSize == minSize && m_maxAutoSize == maxSize) | 36 if (m_minAutoSize == minSize && m_maxAutoSize == maxSize) |
30 return; | 37 return; |
31 | 38 |
32 m_minAutoSize = minSize; | 39 m_minAutoSize = minSize; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Force the scrollbar state to avoid the scrollbar code adding them and
causing them to be needed. For example, | 134 // Force the scrollbar state to avoid the scrollbar code adding them and
causing them to be needed. For example, |
128 // a vertical scrollbar may cause text to wrap and thus increase the hei
ght (which is the only reason the scollbar is needed). | 135 // a vertical scrollbar may cause text to wrap and thus increase the hei
ght (which is the only reason the scollbar is needed). |
129 m_frameView->setVerticalScrollbarLock(false); | 136 m_frameView->setVerticalScrollbarLock(false); |
130 m_frameView->setHorizontalScrollbarLock(false); | 137 m_frameView->setHorizontalScrollbarLock(false); |
131 m_frameView->setScrollbarModes(horizonalScrollbarMode, verticalScrollbar
Mode, true, true); | 138 m_frameView->setScrollbarModes(horizonalScrollbarMode, verticalScrollbar
Mode, true, true); |
132 } | 139 } |
133 m_didRunAutosize = true; | 140 m_didRunAutosize = true; |
134 } | 141 } |
135 | 142 |
136 } // namespace blink | 143 } // namespace blink |
OLD | NEW |