OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. | 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 28 matching lines...) Expand all Loading... |
39 // TODO(joelhockey): Move core/paint/ScrollbarManager to platform/scroll | 39 // TODO(joelhockey): Move core/paint/ScrollbarManager to platform/scroll |
40 // and use it to replace this class. | 40 // and use it to replace this class. |
41 class PLATFORM_EXPORT FrameViewBase : public GarbageCollectedMixin { | 41 class PLATFORM_EXPORT FrameViewBase : public GarbageCollectedMixin { |
42 public: | 42 public: |
43 FrameViewBase(){}; | 43 FrameViewBase(){}; |
44 virtual ~FrameViewBase(){}; | 44 virtual ~FrameViewBase(){}; |
45 | 45 |
46 virtual IntPoint Location() const = 0; | 46 virtual IntPoint Location() const = 0; |
47 | 47 |
48 virtual bool IsFrameView() const { return false; } | 48 virtual bool IsFrameView() const { return false; } |
49 virtual bool IsRemoteFrameView() const { return false; } | |
50 virtual bool IsErrorplaceholder() { return false; } | |
51 | 49 |
52 virtual void SetParent(FrameViewBase*) = 0; | |
53 virtual FrameViewBase* Parent() const = 0; | 50 virtual FrameViewBase* Parent() const = 0; |
54 | 51 |
55 // TODO(joelhockey): Remove this from FrameViewBase once FrameView children | |
56 // use FrameOrPlugin rather than FrameViewBase. This method does not apply to | |
57 // scrollbars. | |
58 virtual void SetParentVisible(bool visible) {} | |
59 | |
60 // ConvertFromRootFrame must be in FrameViewBase rather than FrameView | 52 // ConvertFromRootFrame must be in FrameViewBase rather than FrameView |
61 // to be visible to Scrollbar::ConvertFromRootFrame and | 53 // to be visible to Scrollbar::ConvertFromRootFrame and |
62 // RemoteFrameView::UpdateRemoteViewportIntersection. The related | 54 // RemoteFrameView::UpdateRemoteViewportIntersection. The related |
63 // ConvertFromContainingFrameViewBase must be declared locally to be visible. | 55 // ConvertFromContainingFrameViewBase must be declared locally to be visible. |
64 IntRect ConvertFromRootFrame(const IntRect& rect_in_root_frame) const { | 56 IntRect ConvertFromRootFrame(const IntRect& rect_in_root_frame) const { |
65 if (const FrameViewBase* parent_frame_view_base = Parent()) { | 57 if (const FrameViewBase* parent_frame_view_base = Parent()) { |
66 IntRect parent_rect = | 58 IntRect parent_rect = |
67 parent_frame_view_base->ConvertFromRootFrame(rect_in_root_frame); | 59 parent_frame_view_base->ConvertFromRootFrame(rect_in_root_frame); |
68 return ConvertFromContainingFrameViewBase(parent_rect); | 60 return ConvertFromContainingFrameViewBase(parent_rect); |
69 } | 61 } |
(...skipping 23 matching lines...) Expand all Loading... |
93 const int kFactor = 1000; | 85 const int kFactor = 1000; |
94 IntPoint parent_line_end = ConvertFromRootFrame( | 86 IntPoint parent_line_end = ConvertFromRootFrame( |
95 floored_point + RoundedIntSize(window_fraction.ScaledBy(kFactor))); | 87 floored_point + RoundedIntSize(window_fraction.ScaledBy(kFactor))); |
96 FloatSize parent_fraction = | 88 FloatSize parent_fraction = |
97 (parent_line_end - parent_point).ScaledBy(1.0f / kFactor); | 89 (parent_line_end - parent_point).ScaledBy(1.0f / kFactor); |
98 parent_point.Move(parent_fraction); | 90 parent_point.Move(parent_fraction); |
99 } | 91 } |
100 return parent_point; | 92 return parent_point; |
101 } | 93 } |
102 | 94 |
103 // TODO(joelhockey): Change all these to pure virtual functions | 95 virtual IntRect ConvertFromContainingFrameViewBase(const IntRect&) const = 0; |
104 // Once RemoteFrameView no longer inherits from FrameViewBase. | |
105 virtual IntRect ConvertFromContainingFrameViewBase( | |
106 const IntRect& parent_rect) const { | |
107 NOTREACHED(); | |
108 return parent_rect; | |
109 } | |
110 virtual IntPoint ConvertFromContainingFrameViewBase( | 96 virtual IntPoint ConvertFromContainingFrameViewBase( |
111 const IntPoint& parent_point) const { | 97 const IntPoint&) const = 0; |
112 NOTREACHED(); | |
113 return parent_point; | |
114 } | |
115 | |
116 virtual void FrameRectsChanged() { NOTREACHED(); } | |
117 | 98 |
118 virtual void Dispose() {} | 99 virtual void Dispose() {} |
119 }; | 100 }; |
120 | 101 |
121 } // namespace blink | 102 } // namespace blink |
122 | 103 |
123 #endif // FrameViewBase_h | 104 #endif // FrameViewBase_h |
OLD | NEW |