| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "content/browser/tab_contents/navigation_entry.h" | 13 #include "content/browser/tab_contents/navigation_entry.h" |
| 14 #include "content/common/navigation_types.h" | 14 #include "content/common/navigation_types.h" |
| 15 #include "content/common/page_transition_types.h" | 15 #include "content/common/page_transition_types.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 #include "webkit/glue/window_open_disposition.h" | 17 #include "webkit/glue/window_open_disposition.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; |
| 20 class JavaScriptDialogCreator; | 21 class JavaScriptDialogCreator; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| 24 class Point; | 25 class Point; |
| 25 class Rect; | 26 class Rect; |
| 26 class Size; | 27 class Size; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace history { | 30 namespace history { |
| 30 class HistoryAddPageArgs; | 31 class HistoryAddPageArgs; |
| 31 } | 32 } |
| 32 | 33 |
| 33 struct ContextMenuParams; | 34 struct ContextMenuParams; |
| 34 class DownloadItem; | 35 class DownloadItem; |
| 35 class GURL; | 36 class GURL; |
| 36 class HtmlDialogUIDelegate; | 37 class HtmlDialogUIDelegate; |
| 37 struct NativeWebKeyboardEvent; | 38 struct NativeWebKeyboardEvent; |
| 38 class Profile; | |
| 39 class RenderViewHost; | 39 class RenderViewHost; |
| 40 class TabContents; | 40 class TabContents; |
| 41 | 41 |
| 42 // Objects implement this interface to get notified about changes in the | 42 // Objects implement this interface to get notified about changes in the |
| 43 // TabContents and to provide necessary functionality. | 43 // TabContents and to provide necessary functionality. |
| 44 class TabContentsDelegate { | 44 class TabContentsDelegate { |
| 45 public: | 45 public: |
| 46 TabContentsDelegate(); | 46 TabContentsDelegate(); |
| 47 | 47 |
| 48 // Opens a new URL inside the passed in TabContents (if source is 0 open | 48 // Opens a new URL inside the passed in TabContents (if source is 0 open |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // Returns true if the context menu operation was handled by the delegate. | 208 // Returns true if the context menu operation was handled by the delegate. |
| 209 virtual bool HandleContextMenu(const ContextMenuParams& params); | 209 virtual bool HandleContextMenu(const ContextMenuParams& params); |
| 210 | 210 |
| 211 // Returns true if the context menu command was handled | 211 // Returns true if the context menu command was handled |
| 212 virtual bool ExecuteContextMenuCommand(int command); | 212 virtual bool ExecuteContextMenuCommand(int command); |
| 213 | 213 |
| 214 // Shows the page info using the specified information. | 214 // Shows the page info using the specified information. |
| 215 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL | 215 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL |
| 216 // information for that page/frame. If |show_history| is true, a section | 216 // information for that page/frame. If |show_history| is true, a section |
| 217 // showing how many times that URL has been visited is added to the page info. | 217 // showing how many times that URL has been visited is added to the page info. |
| 218 virtual void ShowPageInfo(Profile* profile, | 218 virtual void ShowPageInfo(content::BrowserContext* browser_context, |
| 219 const GURL& url, | 219 const GURL& url, |
| 220 const NavigationEntry::SSLStatus& ssl, | 220 const NavigationEntry::SSLStatus& ssl, |
| 221 bool show_history); | 221 bool show_history); |
| 222 | 222 |
| 223 // Opens source view for given tab contents that is navigated to the given | 223 // Opens source view for given tab contents that is navigated to the given |
| 224 // page url. | 224 // page url. |
| 225 virtual void ViewSourceForTab(TabContents* source, const GURL& page_url); | 225 virtual void ViewSourceForTab(TabContents* source, const GURL& page_url); |
| 226 | 226 |
| 227 // Opens source view for the given subframe. | 227 // Opens source view for the given subframe. |
| 228 virtual void ViewSourceForFrame(TabContents* source, | 228 virtual void ViewSourceForFrame(TabContents* source, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void Attach(TabContents* source); | 302 void Attach(TabContents* source); |
| 303 | 303 |
| 304 // Called when |this| is no longer the TabContentsDelegate for |source|. | 304 // Called when |this| is no longer the TabContentsDelegate for |source|. |
| 305 void Detach(TabContents* source); | 305 void Detach(TabContents* source); |
| 306 | 306 |
| 307 // The TabContents that this is currently a delegate for. | 307 // The TabContents that this is currently a delegate for. |
| 308 std::set<TabContents*> attached_contents_; | 308 std::set<TabContents*> attached_contents_; |
| 309 }; | 309 }; |
| 310 | 310 |
| 311 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 311 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |