Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / FrameViewAutoSizeInfo.h
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
3 // found in the LICENSE file.
4
5 #ifndef FrameViewAutoSizeInfo_h
6 #define FrameViewAutoSizeInfo_h
7
8 #include "platform/geometry/IntSize.h"
9 #include "wtf/FastAllocBase.h"
10 #include "wtf/Noncopyable.h"
11 #include "wtf/RefPtr.h"
12
13 namespace blink {
14
15 class FrameView;
16
17 class FrameViewAutoSizeInfo {
18     WTF_MAKE_NONCOPYABLE(FrameViewAutoSizeInfo);
19     WTF_MAKE_FAST_ALLOCATED;
20
21 public:
22     FrameViewAutoSizeInfo(FrameView*);
23     ~FrameViewAutoSizeInfo();
24     void configureAutoSizeMode(const IntSize& minSize, const IntSize& maxSize);
25     void autoSizeIfNeeded();
26
27 private:
28     void removeAutoSizeMode();
29
30     RefPtr<FrameView> m_frameView;
31
32     bool m_inAutoSize;
33     // True if autosize has been run since m_shouldAutoSize was set.
34     bool m_didRunAutosize;
35     // The lower bound on the size when autosizing.
36     IntSize m_minAutoSize;
37     // The upper bound on the size when autosizing.
38     IntSize m_maxAutoSize;
39 };
40
41 } // namespace blink
42
43 #endif // FrameViewAutoSizeInfo_h