Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/ui/browser.h

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 string16 GetWindowTitleForCurrentTab() const; 286 string16 GetWindowTitleForCurrentTab() const;
287 287
288 // Prepares a title string for display (removes embedded newlines, etc). 288 // Prepares a title string for display (removes embedded newlines, etc).
289 static void FormatTitleForDisplay(string16* title); 289 static void FormatTitleForDisplay(string16* title);
290 290
291 // OnBeforeUnload handling ////////////////////////////////////////////////// 291 // OnBeforeUnload handling //////////////////////////////////////////////////
292 292
293 // Gives beforeunload handlers the chance to cancel the close. 293 // Gives beforeunload handlers the chance to cancel the close.
294 bool ShouldCloseWindow(); 294 bool ShouldCloseWindow();
295 295
296 // Figure out if there are tabs that have beforeunload handlers.
297 // It starts beforeunload/unload processing as a side-effect.
298 bool TabsNeedBeforeUnloadFired();
299
300 // Returns true if all tabs' beforeunload/unload events have fired.
301 bool HasCompletedUnloadProcessing() const;
302
296 bool IsAttemptingToCloseBrowser() const; 303 bool IsAttemptingToCloseBrowser() const;
297 304
298 // Invoked when the window containing us is closing. Performs the necessary 305 // Invoked when the window containing us is closing. Performs the necessary
299 // cleanup. 306 // cleanup.
300 void OnWindowClosing(); 307 void OnWindowClosing();
301 308
302 // In-progress download termination handling ///////////////////////////////// 309 // In-progress download termination handling /////////////////////////////////
303 310
304 // Called when the user has decided whether to proceed or not with the browser 311 // 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 312 // closure. |cancel_downloads| is true if the downloads should be canceled
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Overridden from content::WebContentsDelegate: 430 // Overridden from content::WebContentsDelegate:
424 virtual bool CanOverscrollContent() const OVERRIDE; 431 virtual bool CanOverscrollContent() const OVERRIDE;
425 virtual bool PreHandleKeyboardEvent( 432 virtual bool PreHandleKeyboardEvent(
426 content::WebContents* source, 433 content::WebContents* source,
427 const content::NativeWebKeyboardEvent& event, 434 const content::NativeWebKeyboardEvent& event,
428 bool* is_keyboard_shortcut) OVERRIDE; 435 bool* is_keyboard_shortcut) OVERRIDE;
429 virtual void HandleKeyboardEvent( 436 virtual void HandleKeyboardEvent(
430 content::WebContents* source, 437 content::WebContents* source,
431 const content::NativeWebKeyboardEvent& event) OVERRIDE; 438 const content::NativeWebKeyboardEvent& event) OVERRIDE;
432 439
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; } 440 bool is_type_tabbed() const { return type_ == TYPE_TABBED; }
437 bool is_type_popup() const { return type_ == TYPE_POPUP; } 441 bool is_type_popup() const { return type_ == TYPE_POPUP; }
438 442
439 bool is_app() const; 443 bool is_app() const;
440 bool is_devtools() const; 444 bool is_devtools() const;
441 445
442 // True when the mouse cursor is locked. 446 // True when the mouse cursor is locked.
443 bool IsMouseLocked() const; 447 bool IsMouseLocked() const;
444 448
445 // Called each time the browser window is shown. 449 // Called each time the browser window is shown.
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 910
907 scoped_ptr<chrome::BrowserCommandController> command_controller_; 911 scoped_ptr<chrome::BrowserCommandController> command_controller_;
908 912
909 // True if the browser window has been shown at least once. 913 // True if the browser window has been shown at least once.
910 bool window_has_shown_; 914 bool window_has_shown_;
911 915
912 DISALLOW_COPY_AND_ASSIGN(Browser); 916 DISALLOW_COPY_AND_ASSIGN(Browser);
913 }; 917 };
914 918
915 #endif // CHROME_BROWSER_UI_BROWSER_H_ 919 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698