OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 // If we try to close the tab while a drag is in progress, we crash. These | 131 // If we try to close the tab while a drag is in progress, we crash. These |
132 // methods allow the tab contents to determine if a drag is in progress and | 132 // methods allow the tab contents to determine if a drag is in progress and |
133 // postpone the tab closing. | 133 // postpone the tab closing. |
134 virtual bool IsDoingDrag() const { | 134 virtual bool IsDoingDrag() const { |
135 return false; | 135 return false; |
136 } | 136 } |
137 virtual void CancelDragAndCloseTab() {} | 137 virtual void CancelDragAndCloseTab() {} |
138 | 138 |
| 139 // If we close the tab while a UI control is in an event-tracking |
| 140 // loop, the control may message freed objects and crash. |
| 141 // TabContents::Close() calls IsEventTracking(), and if it returns |
| 142 // true CloseTabAfterEventTracking() is called and the close is not |
| 143 // completed. |
| 144 virtual bool IsEventTracking() const { |
| 145 return false; |
| 146 } |
| 147 virtual void CloseTabAfterEventTracking() {} |
| 148 |
139 protected: | 149 protected: |
140 TabContentsView() {} // Abstract interface. | 150 TabContentsView() {} // Abstract interface. |
141 | 151 |
142 // Internal functions used to support the CreateNewWidget() method. If a | 152 // Internal functions used to support the CreateNewWidget() method. If a |
143 // platform requires plugging into widget creation at a lower level then a | 153 // platform requires plugging into widget creation at a lower level then a |
144 // subclass might want to override these functions, but otherwise they should | 154 // subclass might want to override these functions, but otherwise they should |
145 // be fine just implementing RenderWidgetHostView::InitAsPopup(). | 155 // be fine just implementing RenderWidgetHostView::InitAsPopup(). |
146 // | 156 // |
147 // The Create function returns the newly created widget so it can be | 157 // The Create function returns the newly created widget so it can be |
148 // associated with the given route. When the widget needs to be shown later, | 158 // associated with the given route. When the widget needs to be shown later, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 193 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
184 PendingWidgetViews pending_widget_views_; | 194 PendingWidgetViews pending_widget_views_; |
185 | 195 |
186 // The page content's intrinsic width. | 196 // The page content's intrinsic width. |
187 int preferred_width_; | 197 int preferred_width_; |
188 | 198 |
189 DISALLOW_COPY_AND_ASSIGN(TabContentsView); | 199 DISALLOW_COPY_AND_ASSIGN(TabContentsView); |
190 }; | 200 }; |
191 | 201 |
192 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 202 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
OLD | NEW |