OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Reloading can be disabled e. g. for the DevTools window. | 147 // Reloading can be disabled e. g. for the DevTools window. |
148 virtual bool CanReloadContents(TabContents* source) const; | 148 virtual bool CanReloadContents(TabContents* source) const; |
149 | 149 |
150 // Show a dialog with HTML content. |delegate| contains a pointer to the | 150 // Show a dialog with HTML content. |delegate| contains a pointer to the |
151 // delegate who knows how to display the dialog (which file URL and JSON | 151 // delegate who knows how to display the dialog (which file URL and JSON |
152 // string input to use during initialization). |parent_window| is the window | 152 // string input to use during initialization). |parent_window| is the window |
153 // that should be parent of the dialog, or NULL for the default. | 153 // that should be parent of the dialog, or NULL for the default. |
154 virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, | 154 virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, |
155 gfx::NativeWindow parent_window); | 155 gfx::NativeWindow parent_window); |
156 | 156 |
| 157 // Returns true if javascript dialogs and unload alerts are suppressed. |
| 158 // Default is false. |
| 159 virtual bool ShouldSuppressDialogs(); |
| 160 |
157 // Tells us that we've finished firing this tab's beforeunload event. | 161 // Tells us that we've finished firing this tab's beforeunload event. |
158 // The proceed bool tells us whether the user chose to proceed closing the | 162 // The proceed bool tells us whether the user chose to proceed closing the |
159 // tab. Returns true if the tab can continue on firing it's unload event. | 163 // tab. Returns true if the tab can continue on firing it's unload event. |
160 // If we're closing the entire browser, then we'll want to delay firing | 164 // If we're closing the entire browser, then we'll want to delay firing |
161 // unload events until all the beforeunload events have fired. | 165 // unload events until all the beforeunload events have fired. |
162 virtual void BeforeUnloadFired(TabContents* tab, | 166 virtual void BeforeUnloadFired(TabContents* tab, |
163 bool proceed, | 167 bool proceed, |
164 bool* proceed_to_fire_unload); | 168 bool* proceed_to_fire_unload); |
165 | 169 |
166 // Send IPC to external host. Default implementation is do nothing. | 170 // Send IPC to external host. Default implementation is do nothing. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 312 |
309 // Notifies the delegate that the content restrictions for this tab has | 313 // Notifies the delegate that the content restrictions for this tab has |
310 // changed. | 314 // changed. |
311 virtual void ContentRestrictionsChanged(TabContents* source); | 315 virtual void ContentRestrictionsChanged(TabContents* source); |
312 | 316 |
313 protected: | 317 protected: |
314 virtual ~TabContentsDelegate(); | 318 virtual ~TabContentsDelegate(); |
315 }; | 319 }; |
316 | 320 |
317 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 321 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
OLD | NEW |