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 "core/frame/FrameViewAutoSizeInfo.h" | 5 #include "core/frame/FrameViewAutoSizeInfo.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
11 #include "core/layout/api/LayoutViewItem.h" | 11 #include "core/layout/api/LayoutViewItem.h" |
12 #include "platform/wtf/AutoReset.h" | 12 #include "platform/wtf/AutoReset.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 FrameViewAutoSizeInfo::FrameViewAutoSizeInfo(FrameView* view) | 16 FrameViewAutoSizeInfo::FrameViewAutoSizeInfo(FrameView* view) |
17 : frame_view_(view), in_auto_size_(false), did_run_autosize_(false) { | 17 : frame_view_(view), in_auto_size_(false), did_run_autosize_(false) { |
18 DCHECK(frame_view_); | 18 DCHECK(frame_view_); |
19 } | 19 } |
20 | 20 |
21 DEFINE_TRACE(FrameViewAutoSizeInfo) { | 21 DEFINE_TRACE(FrameViewAutoSizeInfo) { |
22 visitor->Trace(frame_view_); | 22 visitor->Trace(frame_view_); |
23 } | 23 } |
24 | 24 |
25 void FrameViewAutoSizeInfo::ConfigureAutoSizeMode(const IntSize& min_size, | 25 void FrameViewAutoSizeInfo::ConfigureAutoSizeMode(const IntSize& min_size, |
26 const IntSize& max_size) { | 26 const IntSize& max_size) { |
27 DCHECK(!min_size.IsEmpty()); | 27 DCHECK(!min_size.IsEmpty()); |
28 ASSERT(min_size.Width() <= max_size.Width()); | 28 DCHECK_LE(min_size.Width(), max_size.Width()); |
29 ASSERT(min_size.Height() <= max_size.Height()); | 29 DCHECK_LE(min_size.Height(), max_size.Height()); |
30 | 30 |
31 if (min_auto_size_ == min_size && max_auto_size_ == max_size) | 31 if (min_auto_size_ == min_size && max_auto_size_ == max_size) |
32 return; | 32 return; |
33 | 33 |
34 min_auto_size_ = min_size; | 34 min_auto_size_ = min_size; |
35 max_auto_size_ = max_size; | 35 max_auto_size_ = max_size; |
36 did_run_autosize_ = false; | 36 did_run_autosize_ = false; |
37 } | 37 } |
38 | 38 |
39 void FrameViewAutoSizeInfo::AutoSizeIfNeeded() { | 39 void FrameViewAutoSizeInfo::AutoSizeIfNeeded() { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // scollbar is needed). | 141 // scollbar is needed). |
142 frame_view_->SetVerticalScrollbarLock(false); | 142 frame_view_->SetVerticalScrollbarLock(false); |
143 frame_view_->SetHorizontalScrollbarLock(false); | 143 frame_view_->SetHorizontalScrollbarLock(false); |
144 frame_view_->SetScrollbarModes(horizonal_scrollbar_mode, | 144 frame_view_->SetScrollbarModes(horizonal_scrollbar_mode, |
145 vertical_scrollbar_mode, true, true); | 145 vertical_scrollbar_mode, true, true); |
146 } | 146 } |
147 did_run_autosize_ = true; | 147 did_run_autosize_ = true; |
148 } | 148 } |
149 | 149 |
150 } // namespace blink | 150 } // namespace blink |
OLD | NEW |