OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // Causes the delegate to detach |source| and clean up any internal data | 124 // Causes the delegate to detach |source| and clean up any internal data |
125 // pointing to it. After this call ownership of |source| passes to the | 125 // pointing to it. After this call ownership of |source| passes to the |
126 // caller, and it is safe to call "source->set_delegate(someone_else);". | 126 // caller, and it is safe to call "source->set_delegate(someone_else);". |
127 virtual void DetachContents(TabContents* source); | 127 virtual void DetachContents(TabContents* source); |
128 | 128 |
129 // Called to determine if the TabContents is contained in a popup window | 129 // Called to determine if the TabContents is contained in a popup window |
130 // or a panel window. | 130 // or a panel window. |
131 virtual bool IsPopupOrPanel(const TabContents* source) const; | 131 virtual bool IsPopupOrPanel(const TabContents* source) const; |
132 | 132 |
133 // Returns true if constrained windows should be focused. Default is true. | |
134 virtual bool ShouldFocusConstrainedWindow(); | |
135 | |
136 // Invoked prior to the TabContents showing a constrained window. | |
137 virtual void WillShowConstrainedWindow(TabContents* source); | |
138 | |
139 // Notification that the target URL has changed. | 133 // Notification that the target URL has changed. |
140 virtual void UpdateTargetURL(TabContents* source, int32 page_id, | 134 virtual void UpdateTargetURL(TabContents* source, int32 page_id, |
141 const GURL& url); | 135 const GURL& url); |
142 | 136 |
143 // Notification that there was a mouse event, along with the absolute | 137 // Notification that there was a mouse event, along with the absolute |
144 // coordinates of the mouse pointer and whether it was a normal motion event | 138 // coordinates of the mouse pointer and whether it was a normal motion event |
145 // (otherwise, the pointer left the contents area). | 139 // (otherwise, the pointer left the contents area). |
146 virtual void ContentsMouseEvent( | 140 virtual void ContentsMouseEvent( |
147 TabContents* source, const gfx::Point& location, bool motion); | 141 TabContents* source, const gfx::Point& location, bool motion); |
148 | 142 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 virtual void RenderWidgetShowing(); | 186 virtual void RenderWidgetShowing(); |
193 | 187 |
194 // This is called when WebKit tells us that it is done tabbing through | 188 // This is called when WebKit tells us that it is done tabbing through |
195 // controls on the page. Provides a way for TabContentsDelegates to handle | 189 // controls on the page. Provides a way for TabContentsDelegates to handle |
196 // this. Returns true if the delegate successfully handled it. | 190 // this. Returns true if the delegate successfully handled it. |
197 virtual bool TakeFocus(bool reverse); | 191 virtual bool TakeFocus(bool reverse); |
198 | 192 |
199 // Invoked when the page loses mouse capture. | 193 // Invoked when the page loses mouse capture. |
200 virtual void LostCapture(); | 194 virtual void LostCapture(); |
201 | 195 |
202 // Changes the blocked state of the tab at |index|. TabContents are | |
203 // considered blocked while displaying a tab modal dialog. During that time | |
204 // renderer host will ignore any UI interaction within TabContent outside of | |
205 // the currently displaying dialog. | |
206 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); | |
207 | |
208 // Notification that |tab_contents| has gained focus. | 196 // Notification that |tab_contents| has gained focus. |
209 virtual void TabContentsFocused(TabContents* tab_content); | 197 virtual void TabContentsFocused(TabContents* tab_content); |
210 | 198 |
211 // Asks the delegate if the given tab can download. | 199 // Asks the delegate if the given tab can download. |
212 virtual bool CanDownload(TabContents* source, int request_id); | 200 virtual bool CanDownload(TabContents* source, int request_id); |
213 | 201 |
214 // Notifies the delegate that a download is starting. | 202 // Notifies the delegate that a download is starting. |
215 virtual void OnStartDownload(TabContents* source, DownloadItem* download); | 203 virtual void OnStartDownload(TabContents* source, DownloadItem* download); |
216 | 204 |
217 // Return much extra vertical space should be allotted to the | 205 // Return much extra vertical space should be allotted to the |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void Attach(TabContents* source); | 357 void Attach(TabContents* source); |
370 | 358 |
371 // Called when |this| is no longer the TabContentsDelegate for |source|. | 359 // Called when |this| is no longer the TabContentsDelegate for |source|. |
372 void Detach(TabContents* source); | 360 void Detach(TabContents* source); |
373 | 361 |
374 // The TabContents that this is currently a delegate for. | 362 // The TabContents that this is currently a delegate for. |
375 std::set<TabContents*> attached_contents_; | 363 std::set<TabContents*> attached_contents_; |
376 }; | 364 }; |
377 | 365 |
378 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 366 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
OLD | NEW |