OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // Invoked prior to showing before unload handler confirmation dialog. | 172 // Invoked prior to showing before unload handler confirmation dialog. |
173 virtual void WillRunBeforeUnloadConfirm() {} | 173 virtual void WillRunBeforeUnloadConfirm() {} |
174 | 174 |
175 // Returns true if javascript dialogs and unload alerts are suppressed. | 175 // Returns true if javascript dialogs and unload alerts are suppressed. |
176 // Default is false. | 176 // Default is false. |
177 virtual bool ShouldSuppressDialogs(); | 177 virtual bool ShouldSuppressDialogs(); |
178 | 178 |
179 // Tells us that we've finished firing this tab's beforeunload event. | 179 // Tells us that we've finished firing this tab's beforeunload event. |
180 // The proceed bool tells us whether the user chose to proceed closing the | 180 // The proceed bool tells us whether the user chose to proceed closing the |
181 // tab. Returns true if the tab can continue on firing it's unload event. | 181 // tab. Returns true if the tab can continue on firing its unload event. |
182 // If we're closing the entire browser, then we'll want to delay firing | 182 // If we're closing the entire browser, then we'll want to delay firing |
183 // unload events until all the beforeunload events have fired. | 183 // unload events until all the beforeunload events have fired. |
184 virtual void BeforeUnloadFired(WebContents* tab, | 184 virtual void BeforeUnloadFired(WebContents* tab, |
185 bool proceed, | 185 bool proceed, |
186 bool* proceed_to_fire_unload); | 186 bool* proceed_to_fire_unload); |
187 | 187 |
188 // Sets focus to the location bar or some other place that is appropriate. | 188 // Sets focus to the location bar or some other place that is appropriate. |
189 // This is called when the tab wants to encourage user input, like for the | 189 // This is called when the tab wants to encourage user input, like for the |
190 // new tab page. | 190 // new tab page. |
191 virtual void SetFocusToLocationBar(bool select_all) {} | 191 virtual void SetFocusToLocationBar(bool select_all) {} |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Called when |this| is no longer the WebContentsDelegate for |source|. | 404 // Called when |this| is no longer the WebContentsDelegate for |source|. |
405 void Detach(WebContents* source); | 405 void Detach(WebContents* source); |
406 | 406 |
407 // The WebContents that this is currently a delegate for. | 407 // The WebContents that this is currently a delegate for. |
408 std::set<WebContents*> attached_contents_; | 408 std::set<WebContents*> attached_contents_; |
409 }; | 409 }; |
410 | 410 |
411 } // namespace content | 411 } // namespace content |
412 | 412 |
413 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 413 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
OLD | NEW |