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 CHROME_BROWSER_UI_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 class SearchDelegate; | 59 class SearchDelegate; |
60 class SearchModel; | 60 class SearchModel; |
61 class StatusBubble; | 61 class StatusBubble; |
62 class TabStripModel; | 62 class TabStripModel; |
63 class TabStripModelDelegate; | 63 class TabStripModelDelegate; |
64 struct SearchMode; | 64 struct SearchMode; |
65 struct WebApplicationInfo; | 65 struct WebApplicationInfo; |
66 | 66 |
67 namespace chrome { | 67 namespace chrome { |
68 class BrowserCommandController; | 68 class BrowserCommandController; |
| 69 class FastUnloadController; |
69 class UnloadController; | 70 class UnloadController; |
70 } | 71 } |
71 | 72 |
72 namespace content { | 73 namespace content { |
73 class NavigationController; | 74 class NavigationController; |
74 class PageState; | 75 class PageState; |
75 class SessionStorageNamespace; | 76 class SessionStorageNamespace; |
76 } | 77 } |
77 | 78 |
78 namespace extensions { | 79 namespace extensions { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 string16 GetWindowTitleForCurrentTab() const; | 287 string16 GetWindowTitleForCurrentTab() const; |
287 | 288 |
288 // Prepares a title string for display (removes embedded newlines, etc). | 289 // Prepares a title string for display (removes embedded newlines, etc). |
289 static void FormatTitleForDisplay(string16* title); | 290 static void FormatTitleForDisplay(string16* title); |
290 | 291 |
291 // OnBeforeUnload handling ////////////////////////////////////////////////// | 292 // OnBeforeUnload handling ////////////////////////////////////////////////// |
292 | 293 |
293 // Gives beforeunload handlers the chance to cancel the close. | 294 // Gives beforeunload handlers the chance to cancel the close. |
294 bool ShouldCloseWindow(); | 295 bool ShouldCloseWindow(); |
295 | 296 |
| 297 // Figure out if there are tabs that have beforeunload handlers. |
| 298 // It starts beforeunload/unload processing as a side-effect. |
| 299 bool TabsNeedBeforeUnloadFired(); |
| 300 |
| 301 // Returns true if all tabs' beforeunload/unload events have fired. |
| 302 bool HasCompletedUnloadProcessing() const; |
| 303 |
296 bool IsAttemptingToCloseBrowser() const; | 304 bool IsAttemptingToCloseBrowser() const; |
297 | 305 |
298 // Invoked when the window containing us is closing. Performs the necessary | 306 // Invoked when the window containing us is closing. Performs the necessary |
299 // cleanup. | 307 // cleanup. |
300 void OnWindowClosing(); | 308 void OnWindowClosing(); |
301 | 309 |
302 // In-progress download termination handling ///////////////////////////////// | 310 // In-progress download termination handling ///////////////////////////////// |
303 | 311 |
304 // Called when the user has decided whether to proceed or not with the browser | 312 // Called when the user has decided whether to proceed or not with the browser |
305 // closure. |cancel_downloads| is true if the downloads should be canceled | 313 // closure. |cancel_downloads| is true if the downloads should be canceled |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // Overridden from content::WebContentsDelegate: | 431 // Overridden from content::WebContentsDelegate: |
424 virtual bool CanOverscrollContent() const OVERRIDE; | 432 virtual bool CanOverscrollContent() const OVERRIDE; |
425 virtual bool PreHandleKeyboardEvent( | 433 virtual bool PreHandleKeyboardEvent( |
426 content::WebContents* source, | 434 content::WebContents* source, |
427 const content::NativeWebKeyboardEvent& event, | 435 const content::NativeWebKeyboardEvent& event, |
428 bool* is_keyboard_shortcut) OVERRIDE; | 436 bool* is_keyboard_shortcut) OVERRIDE; |
429 virtual void HandleKeyboardEvent( | 437 virtual void HandleKeyboardEvent( |
430 content::WebContents* source, | 438 content::WebContents* source, |
431 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 439 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
432 | 440 |
433 // Figure out if there are tabs that have beforeunload handlers. | |
434 bool TabsNeedBeforeUnloadFired(); | |
435 | |
436 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } | 441 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } |
437 bool is_type_popup() const { return type_ == TYPE_POPUP; } | 442 bool is_type_popup() const { return type_ == TYPE_POPUP; } |
438 | 443 |
439 bool is_app() const; | 444 bool is_app() const; |
440 bool is_devtools() const; | 445 bool is_devtools() const; |
441 | 446 |
442 // True when the mouse cursor is locked. | 447 // True when the mouse cursor is locked. |
443 bool IsMouseLocked() const; | 448 bool IsMouseLocked() const; |
444 | 449 |
445 // Called each time the browser window is shown. | 450 // Called each time the browser window is shown. |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 // shell shortcut's startup info. | 863 // shell shortcut's startup info. |
859 gfx::Rect override_bounds_; | 864 gfx::Rect override_bounds_; |
860 ui::WindowShowState initial_show_state_; | 865 ui::WindowShowState initial_show_state_; |
861 | 866 |
862 // Tracks when this browser is being created by session restore. | 867 // Tracks when this browser is being created by session restore. |
863 bool is_session_restore_; | 868 bool is_session_restore_; |
864 | 869 |
865 const chrome::HostDesktopType host_desktop_type_; | 870 const chrome::HostDesktopType host_desktop_type_; |
866 | 871 |
867 scoped_ptr<chrome::UnloadController> unload_controller_; | 872 scoped_ptr<chrome::UnloadController> unload_controller_; |
| 873 scoped_ptr<chrome::FastUnloadController> fast_unload_controller_; |
868 | 874 |
869 // The following factory is used to close the frame at a later time. | 875 // The following factory is used to close the frame at a later time. |
870 base::WeakPtrFactory<Browser> weak_factory_; | 876 base::WeakPtrFactory<Browser> weak_factory_; |
871 | 877 |
872 // The Find Bar. This may be NULL if there is no Find Bar, and if it is | 878 // The Find Bar. This may be NULL if there is no Find Bar, and if it is |
873 // non-NULL, it may or may not be visible. | 879 // non-NULL, it may or may not be visible. |
874 scoped_ptr<FindBarController> find_bar_controller_; | 880 scoped_ptr<FindBarController> find_bar_controller_; |
875 | 881 |
876 // Dialog box used for opening and saving files. | 882 // Dialog box used for opening and saving files. |
877 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 883 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
(...skipping 28 matching lines...) Expand all Loading... |
906 | 912 |
907 scoped_ptr<chrome::BrowserCommandController> command_controller_; | 913 scoped_ptr<chrome::BrowserCommandController> command_controller_; |
908 | 914 |
909 // True if the browser window has been shown at least once. | 915 // True if the browser window has been shown at least once. |
910 bool window_has_shown_; | 916 bool window_has_shown_; |
911 | 917 |
912 DISALLOW_COPY_AND_ASSIGN(Browser); | 918 DISALLOW_COPY_AND_ASSIGN(Browser); |
913 }; | 919 }; |
914 | 920 |
915 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 921 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |