| 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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_ |
| 7 | 7 |
| 8 // TODO(maruel): Remove once UINT and HWND are replaced / typedef. | 8 // TODO(maruel): Remove once UINT and HWND are replaced / typedef. |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include "chrome/browser/page_navigator.h" | 11 #include "chrome/browser/page_navigator.h" |
| 12 #include "chrome/common/navigation_types.h" | 12 #include "chrome/common/navigation_types.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Point; | 15 class Point; |
| 16 class Rect; | 16 class Rect; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class TabContents; | 19 class TabContents; |
| 20 class HtmlDialogContentsDelegate; | 20 class HtmlDialogContentsDelegate; |
| 21 | 21 |
| 22 // Objects implement this interface to get notified about changes in the | 22 // Objects implement this interface to get notified about changes in the |
| 23 // TabContents and to provide necessary functionality. | 23 // TabContents and to provide necessary functionality. |
| 24 class TabContentsDelegate : public PageNavigator { | 24 class TabContentsDelegate : public PageNavigator { |
| 25 public: | 25 public: |
| 26 // Opens a new URL inside the passed in TabContents, if source is 0 open | 26 // Opens a new URL inside the passed in TabContents, if source is 0 open |
| 27 // in the current front-most tab. | 27 // in the current front-most tab. |
| 28 virtual void OpenURLFromTab(TabContents* source, | 28 virtual void OpenURLFromTab(TabContents* source, |
| 29 const GURL& url, | 29 const GURL& url, const GURL& referrer, |
| 30 WindowOpenDisposition disposition, | 30 WindowOpenDisposition disposition, |
| 31 PageTransition::Type transition) = 0; | 31 PageTransition::Type transition) = 0; |
| 32 | 32 |
| 33 virtual void OpenURL(const GURL& url, | 33 virtual void OpenURL(const GURL& url, const GURL& referrer, |
| 34 WindowOpenDisposition disposition, | 34 WindowOpenDisposition disposition, |
| 35 PageTransition::Type transition) | 35 PageTransition::Type transition) |
| 36 { | 36 { |
| 37 OpenURLFromTab(NULL, url, disposition, transition); | 37 OpenURLFromTab(NULL, url, referrer, disposition, transition); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Called to inform the delegate that the tab content's navigation state | 40 // Called to inform the delegate that the tab content's navigation state |
| 41 // changed. The |changed_flags| indicates the parts of the navigation state | 41 // changed. The |changed_flags| indicates the parts of the navigation state |
| 42 // that have been updated, and is any combination of the | 42 // that have been updated, and is any combination of the |
| 43 // |TabContents::InvalidateTypes| bits. | 43 // |TabContents::InvalidateTypes| bits. |
| 44 virtual void NavigationStateChanged(const TabContents* source, | 44 virtual void NavigationStateChanged(const TabContents* source, |
| 45 unsigned changed_flags) = 0; | 45 unsigned changed_flags) = 0; |
| 46 | 46 |
| 47 // Called to cause the delegate to replace the source contents with the new | 47 // Called to cause the delegate to replace the source contents with the new |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 *proceed_to_fire_unload = true; | 154 *proceed_to_fire_unload = true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Send IPC to external host. Default implementation is do nothing. | 157 // Send IPC to external host. Default implementation is do nothing. |
| 158 virtual void ForwardMessageToExternalHost(const std::string& receiver, | 158 virtual void ForwardMessageToExternalHost(const std::string& receiver, |
| 159 const std::string& message) {}; | 159 const std::string& message) {}; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 #endif // CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_ | 162 #endif // CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_ |
| 163 | 163 |
| OLD | NEW |