| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 string16 GetWindowTitleForCurrentTab() const; | 293 string16 GetWindowTitleForCurrentTab() const; |
| 294 | 294 |
| 295 // Prepares a title string for display (removes embedded newlines, etc). | 295 // Prepares a title string for display (removes embedded newlines, etc). |
| 296 static void FormatTitleForDisplay(string16* title); | 296 static void FormatTitleForDisplay(string16* title); |
| 297 | 297 |
| 298 // OnBeforeUnload handling ////////////////////////////////////////////////// | 298 // OnBeforeUnload handling ////////////////////////////////////////////////// |
| 299 | 299 |
| 300 // Gives beforeunload handlers the chance to cancel the close. | 300 // Gives beforeunload handlers the chance to cancel the close. |
| 301 bool ShouldCloseWindow(); | 301 bool ShouldCloseWindow(); |
| 302 | 302 |
| 303 // Figure out if there are tabs that have beforeunload handlers. |
| 304 // It starts beforeunload/unload processing as a side-effect. |
| 305 bool TabsNeedBeforeUnloadFired(); |
| 306 |
| 303 bool IsAttemptingToCloseBrowser() const; | 307 bool IsAttemptingToCloseBrowser() const; |
| 304 | 308 |
| 305 // Invoked when the window containing us is closing. Performs the necessary | 309 // Invoked when the window containing us is closing. Performs the necessary |
| 306 // cleanup. | 310 // cleanup. |
| 307 void OnWindowClosing(); | 311 void OnWindowClosing(); |
| 308 | 312 |
| 313 // Called when all unload processing completes so the browser can close. |
| 314 void OnUnloadProcessingCompleted(); |
| 315 |
| 309 // OnWindowActivationChanged handling /////////////////////////////////////// | 316 // OnWindowActivationChanged handling /////////////////////////////////////// |
| 310 | 317 |
| 311 // Invoked when the window containing us is activated. | 318 // Invoked when the window containing us is activated. |
| 312 void OnWindowActivated(); | 319 void OnWindowActivated(); |
| 313 | 320 |
| 314 // In-progress download termination handling ///////////////////////////////// | 321 // In-progress download termination handling ///////////////////////////////// |
| 315 | 322 |
| 316 // Called when the user has decided whether to proceed or not with the browser | 323 // Called when the user has decided whether to proceed or not with the browser |
| 317 // closure. |cancel_downloads| is true if the downloads should be canceled | 324 // closure. |cancel_downloads| is true if the downloads should be canceled |
| 318 // and the browser closed, false if the browser should stay open and the | 325 // and the browser closed, false if the browser should stay open and the |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 460 |
| 454 // Overridden from content::WebContentsDelegate: | 461 // Overridden from content::WebContentsDelegate: |
| 455 virtual bool PreHandleKeyboardEvent( | 462 virtual bool PreHandleKeyboardEvent( |
| 456 content::WebContents* source, | 463 content::WebContents* source, |
| 457 const content::NativeWebKeyboardEvent& event, | 464 const content::NativeWebKeyboardEvent& event, |
| 458 bool* is_keyboard_shortcut) OVERRIDE; | 465 bool* is_keyboard_shortcut) OVERRIDE; |
| 459 virtual void HandleKeyboardEvent( | 466 virtual void HandleKeyboardEvent( |
| 460 content::WebContents* source, | 467 content::WebContents* source, |
| 461 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 468 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 462 | 469 |
| 463 // Figure out if there are tabs that have beforeunload handlers. | |
| 464 bool TabsNeedBeforeUnloadFired(); | |
| 465 | |
| 466 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } | 470 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } |
| 467 bool is_type_popup() const { return type_ == TYPE_POPUP; } | 471 bool is_type_popup() const { return type_ == TYPE_POPUP; } |
| 468 bool is_type_panel() const { return type_ == TYPE_PANEL; } | 472 bool is_type_panel() const { return type_ == TYPE_PANEL; } |
| 469 | 473 |
| 470 bool is_app() const; | 474 bool is_app() const; |
| 471 bool is_devtools() const; | 475 bool is_devtools() const; |
| 472 | 476 |
| 473 // True when the mouse cursor is locked. | 477 // True when the mouse cursor is locked. |
| 474 bool IsMouseLocked() const; | 478 bool IsMouseLocked() const; |
| 475 | 479 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 bool window_has_shown_; | 955 bool window_has_shown_; |
| 952 | 956 |
| 953 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 957 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
| 954 // before DidEndColorChooser is called. | 958 // before DidEndColorChooser is called. |
| 955 scoped_ptr<content::ColorChooser> color_chooser_; | 959 scoped_ptr<content::ColorChooser> color_chooser_; |
| 956 | 960 |
| 957 DISALLOW_COPY_AND_ASSIGN(Browser); | 961 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 958 }; | 962 }; |
| 959 | 963 |
| 960 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 964 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |