| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class CullRect; | 40 class CullRect; |
| 41 class Event; | 41 class Event; |
| 42 class GraphicsContext; | 42 class GraphicsContext; |
| 43 | 43 |
| 44 // The FrameViewBase class serves as a base class for FrameView, Scrollbar, and | 44 // The FrameViewBase class serves as a base class for FrameView, Scrollbar, and |
| 45 // PluginView. | 45 // PluginView. |
| 46 // | 46 // |
| 47 // FrameViewBases are connected in a hierarchy, with the restriction that plugin
s and | 47 // FrameViewBases are connected in a hierarchy, with the restriction that |
| 48 // scrollbars are always leaves of the tree. Only FrameView can have children | 48 // plugins and scrollbars are always leaves of the tree. Only FrameView can have |
| 49 // (and therefore the FrameViewBase class has no concept of children). | 49 // children (and therefore the FrameViewBase class has no concept of children). |
| 50 class PLATFORM_EXPORT FrameViewBase : public GarbageCollectedFinalized<FrameView
Base> { | 50 class PLATFORM_EXPORT FrameViewBase |
| 51 : public GarbageCollectedFinalized<FrameViewBase> { |
| 51 public: | 52 public: |
| 52 FrameViewBase(); | 53 FrameViewBase(); |
| 53 virtual ~FrameViewBase(); | 54 virtual ~FrameViewBase(); |
| 54 | 55 |
| 55 int x() const { return frameRect().x(); } | 56 int x() const { return frameRect().x(); } |
| 56 int y() const { return frameRect().y(); } | 57 int y() const { return frameRect().y(); } |
| 57 int width() const { return frameRect().width(); } | 58 int width() const { return frameRect().width(); } |
| 58 int height() const { return frameRect().height(); } | 59 int height() const { return frameRect().height(); } |
| 59 IntSize size() const { return frameRect().size(); } | 60 IntSize size() const { return frameRect().size(); } |
| 60 IntPoint location() const { return frameRect().location(); } | 61 IntPoint location() const { return frameRect().location(); } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 87 } // Whether or not we are actually visible. | 88 } // Whether or not we are actually visible. |
| 88 virtual void setParentVisible(bool visible) { m_parentVisible = visible; } | 89 virtual void setParentVisible(bool visible) { m_parentVisible = visible; } |
| 89 void setSelfVisible(bool v) { m_selfVisible = v; } | 90 void setSelfVisible(bool v) { m_selfVisible = v; } |
| 90 | 91 |
| 91 virtual bool isFrameView() const { return false; } | 92 virtual bool isFrameView() const { return false; } |
| 92 virtual bool isRemoteFrameView() const { return false; } | 93 virtual bool isRemoteFrameView() const { return false; } |
| 93 virtual bool isPluginView() const { return false; } | 94 virtual bool isPluginView() const { return false; } |
| 94 virtual bool isPluginContainer() const { return false; } | 95 virtual bool isPluginContainer() const { return false; } |
| 95 virtual bool isScrollbar() const { return false; } | 96 virtual bool isScrollbar() const { return false; } |
| 96 | 97 |
| 97 virtual void setParent(FrameViewBase *); | 98 virtual void setParent(FrameViewBase*); |
| 98 FrameViewBase* parent() const { return m_parent; } | 99 FrameViewBase* parent() const { return m_parent; } |
| 99 FrameViewBase* root() const; | 100 FrameViewBase* root() const; |
| 100 | 101 |
| 101 virtual void handleEvent(Event*) {} | 102 virtual void handleEvent(Event*) {} |
| 102 | 103 |
| 103 IntRect convertToRootFrame(const IntRect&) const; | 104 IntRect convertToRootFrame(const IntRect&) const; |
| 104 IntRect convertFromRootFrame(const IntRect&) const; | 105 IntRect convertFromRootFrame(const IntRect&) const; |
| 105 | 106 |
| 106 IntPoint convertToRootFrame(const IntPoint&) const; | 107 IntPoint convertToRootFrame(const IntPoint&) const; |
| 107 IntPoint convertFromRootFrame(const IntPoint&) const; | 108 IntPoint convertFromRootFrame(const IntPoint&) const; |
| 108 FloatPoint convertFromRootFrame(const FloatPoint&) const; | 109 FloatPoint convertFromRootFrame(const FloatPoint&) const; |
| 109 | 110 |
| 110 virtual void frameRectsChanged() {} | 111 virtual void frameRectsChanged() {} |
| 111 | 112 |
| 112 virtual void widgetGeometryMayHaveChanged() {} | 113 virtual void widgetGeometryMayHaveChanged() {} |
| 113 | 114 |
| 114 virtual IntRect convertToContainingWidget(const IntRect&) const; | 115 virtual IntRect convertToContainingWidget(const IntRect&) const; |
| 115 virtual IntRect convertFromContainingWidget(const IntRect&) const; | 116 virtual IntRect convertFromContainingWidget(const IntRect&) const; |
| 116 virtual IntPoint convertToContainingWidget(const IntPoint&) const; | 117 virtual IntPoint convertToContainingWidget(const IntPoint&) const; |
| 117 virtual IntPoint convertFromContainingWidget(const IntPoint&) const; | 118 virtual IntPoint convertFromContainingWidget(const IntPoint&) const; |
| 118 | 119 |
| 119 // Virtual methods to convert points to/from child frameviewbases. | 120 // Virtual methods to convert points to/from child frameviewbases. |
| 120 virtual IntPoint convertChildToSelf(const FrameViewBase *, const IntPoint&) co
nst; | 121 virtual IntPoint convertChildToSelf(const FrameViewBase*, |
| 121 virtual IntPoint convertSelfToChild(const FrameViewBase *, const IntPoint&) co
nst; | 122 const IntPoint&) const; |
| 123 virtual IntPoint convertSelfToChild(const FrameViewBase*, |
| 124 const IntPoint&) const; |
| 122 | 125 |
| 123 // Notifies this frameviewbase that it will no longer be receiving events. | 126 // Notifies this frameviewbase that it will no longer be receiving events. |
| 124 virtual void eventListenersRemoved() {} | 127 virtual void eventListenersRemoved() {} |
| 125 | 128 |
| 126 DECLARE_VIRTUAL_TRACE(); | 129 DECLARE_VIRTUAL_TRACE(); |
| 127 virtual void dispose() {} | 130 virtual void dispose() {} |
| 128 | 131 |
| 129 private: | 132 private: |
| 130 Member<FrameViewBase> m_parent; | 133 Member<FrameViewBase> m_parent; |
| 131 IntRect m_frameRect; | 134 IntRect m_frameRect; |
| 132 bool m_selfVisible; | 135 bool m_selfVisible; |
| 133 bool m_parentVisible; | 136 bool m_parentVisible; |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 } // namespace blink | 139 } // namespace blink |
| 137 | 140 |
| 138 #endif // FrameViewBase_h | 141 #endif // FrameViewBase_h |
| OLD | NEW |