| 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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
| 10 #include "chrome/browser/tab_contents/page_navigator.h" | 10 #include "chrome/browser/tab_contents/page_navigator.h" |
| 11 #include "chrome/common/navigation_types.h" | 11 #include "chrome/common/navigation_types.h" |
| 12 | 12 |
| 13 class TabContents; | 13 class TabContents; |
| 14 class HtmlDialogUIDelegate; | 14 class HtmlDialogUIDelegate; |
| 15 | 15 |
| 16 // Objects implement this interface to get notified about changes in the | 16 // Objects implement this interface to get notified about changes in the |
| 17 // TabContents and to provide necessary functionality. | 17 // TabContents and to provide necessary functionality. |
| 18 class TabContentsDelegate : public PageNavigator { | 18 class TabContentsDelegate : public PageNavigator { |
| 19 public: | 19 public: |
| 20 // Opens a new URL inside the passed in TabContents (if source is 0 open | 20 // Opens a new URL inside the passed in TabContents (if source is 0 open |
| 21 // in the current front-most tab), unless |disposition| indicates the url | 21 // in the current front-most tab), unless |disposition| indicates the url |
| 22 // should be opened in a new tab or window. | 22 // should be opened in a new tab or window. |
| 23 // |
| 24 // A NULL source indicates the current tab (callers should probably use |
| 25 // OpenURL() for these cases which does it for you). |
| 23 virtual void OpenURLFromTab(TabContents* source, | 26 virtual void OpenURLFromTab(TabContents* source, |
| 24 const GURL& url, const GURL& referrer, | 27 const GURL& url, const GURL& referrer, |
| 25 WindowOpenDisposition disposition, | 28 WindowOpenDisposition disposition, |
| 26 PageTransition::Type transition) = 0; | 29 PageTransition::Type transition) = 0; |
| 27 | 30 |
| 31 // Wrapper around OpenURLFromTab when there is no source for the given URL |
| 32 // (it will use the current onep. |
| 33 // |
| 34 // This implements the PageNavigator interface. |
| 28 virtual void OpenURL(const GURL& url, const GURL& referrer, | 35 virtual void OpenURL(const GURL& url, const GURL& referrer, |
| 29 WindowOpenDisposition disposition, | 36 WindowOpenDisposition disposition, |
| 30 PageTransition::Type transition) { | 37 PageTransition::Type transition) { |
| 31 OpenURLFromTab(NULL, url, referrer, disposition, transition); | 38 OpenURLFromTab(NULL, url, referrer, disposition, transition); |
| 32 } | 39 } |
| 33 | 40 |
| 34 // Called to inform the delegate that the tab content's navigation state | 41 // Called to inform the delegate that the tab content's navigation state |
| 35 // changed. The |changed_flags| indicates the parts of the navigation state | 42 // changed. The |changed_flags| indicates the parts of the navigation state |
| 36 // that have been updated, and is any combination of the | 43 // that have been updated, and is any combination of the |
| 37 // |TabContents::InvalidateTypes| bits. | 44 // |TabContents::InvalidateTypes| bits. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // new tab page. | 158 // new tab page. |
| 152 virtual void SetFocusToLocationBar() {} | 159 virtual void SetFocusToLocationBar() {} |
| 153 | 160 |
| 154 // Called when a popup select is about to be displayed. The delegate can use | 161 // Called when a popup select is about to be displayed. The delegate can use |
| 155 // this to disable inactive rendering for the frame in the window the select | 162 // this to disable inactive rendering for the frame in the window the select |
| 156 // is opened within if necessary. | 163 // is opened within if necessary. |
| 157 virtual void RenderWidgetShowing() {} | 164 virtual void RenderWidgetShowing() {} |
| 158 }; | 165 }; |
| 159 | 166 |
| 160 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 167 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |