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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Simple mouse event forwarding from the RenderViewHost. | 131 // Simple mouse event forwarding from the RenderViewHost. |
132 virtual void HandleMouseEvent() {} | 132 virtual void HandleMouseEvent() {} |
133 virtual void HandleMouseLeave() {} | 133 virtual void HandleMouseLeave() {} |
134 | 134 |
135 // Set and return the content's intrinsic width. | 135 // Set and return the content's intrinsic width. |
136 virtual void UpdatePreferredWidth(int pref_width); | 136 virtual void UpdatePreferredWidth(int pref_width); |
137 int preferred_width() const { | 137 int preferred_width() const { |
138 return preferred_width_; | 138 return preferred_width_; |
139 } | 139 } |
140 | 140 |
| 141 // If we try to close the tab while a drag is in progress, we crash. These |
| 142 // methods allow the tab contents to determine if a drag is in progress and |
| 143 // postpone the tab closing. |
| 144 virtual bool IsDoingDrag() const { |
| 145 return false; |
| 146 } |
| 147 virtual void CancelDragAndCloseTab() {} |
| 148 |
141 protected: | 149 protected: |
142 TabContentsView() {} // Abstract interface. | 150 TabContentsView() {} // Abstract interface. |
143 | 151 |
144 // Internal functions used to support the CreateNewWidget() method. If a | 152 // Internal functions used to support the CreateNewWidget() method. If a |
145 // 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 |
146 // subclass might want to override these functions, but otherwise they should | 154 // subclass might want to override these functions, but otherwise they should |
147 // be fine just implementing RenderWidgetHostView::InitAsPopup(). | 155 // be fine just implementing RenderWidgetHostView::InitAsPopup(). |
148 // | 156 // |
149 // 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 |
150 // 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... |
185 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 193 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
186 PendingWidgetViews pending_widget_views_; | 194 PendingWidgetViews pending_widget_views_; |
187 | 195 |
188 // The page content's intrinsic width. | 196 // The page content's intrinsic width. |
189 int preferred_width_; | 197 int preferred_width_; |
190 | 198 |
191 DISALLOW_COPY_AND_ASSIGN(TabContentsView); | 199 DISALLOW_COPY_AND_ASSIGN(TabContentsView); |
192 }; | 200 }; |
193 | 201 |
194 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 202 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
OLD | NEW |