OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) |
107 // The web contents view assumes that its view will never be overlapped by | 107 // The web contents view assumes that its view will never be overlapped by |
108 // another view (either partially or fully). This allows it to perform | 108 // another view (either partially or fully). This allows it to perform |
109 // optimizations. If the view is in a view hierarchy where it might be | 109 // optimizations. If the view is in a view hierarchy where it might be |
110 // overlapped by another view, notify the view by calling this with |true|. | 110 // overlapped by another view, notify the view by calling this with |true|. |
111 virtual void SetAllowOverlappingViews(bool overlapping) = 0; | 111 virtual void SetAllowOverlappingViews(bool overlapping) = 0; |
112 | 112 |
113 // Returns true if overlapping views are allowed, false otherwise. | 113 // Returns true if overlapping views are allowed, false otherwise. |
114 virtual bool GetAllowOverlappingViews() const = 0; | 114 virtual bool GetAllowOverlappingViews() const = 0; |
115 | 115 |
116 // To draw two overlapping web contents view, the underlaying one should | 116 // Allowing other views disables optimizations which assume that only a single |
117 // know about the overlaying one. Caller must ensure that |overlay| exists | 117 // WebContents is present. |
118 // until |RemoveOverlayView| is called. | 118 virtual void SetAllowOtherViews(bool allow) = 0; |
119 virtual void SetOverlayView(WebContentsView* overlay, | |
120 const gfx::Point& offset) = 0; | |
121 | 119 |
122 // Removes the previously set overlay view. | 120 // Returns true if other views are allowed, false otherwise. |
123 virtual void RemoveOverlayView() = 0; | 121 virtual bool GetAllowOtherViews() const = 0; |
124 | 122 |
125 // If we close the tab while a UI control is in an event-tracking | 123 // If we close the tab while a UI control is in an event-tracking |
126 // loop, the control may message freed objects and crash. | 124 // loop, the control may message freed objects and crash. |
127 // WebContents::Close() calls IsEventTracking(), and if it returns | 125 // WebContents::Close() calls IsEventTracking(), and if it returns |
128 // true CloseTabAfterEventTracking() is called and the close is not | 126 // true CloseTabAfterEventTracking() is called and the close is not |
129 // completed. | 127 // completed. |
130 virtual bool IsEventTracking() const = 0; | 128 virtual bool IsEventTracking() const = 0; |
131 virtual void CloseTabAfterEventTracking() = 0; | 129 virtual void CloseTabAfterEventTracking() = 0; |
132 #endif | 130 #endif |
133 }; | 131 }; |
134 | 132 |
135 } // namespace content | 133 } // namespace content |
136 | 134 |
137 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 135 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
OLD | NEW |