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

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

Issue 14362028: Speculative Revert 195108 "Changes to closing contents with beforeunload/unl..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | trunk/src/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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 string16 GetWindowTitleForCurrentTab() const; 283 string16 GetWindowTitleForCurrentTab() const;
284 284
285 // Prepares a title string for display (removes embedded newlines, etc). 285 // Prepares a title string for display (removes embedded newlines, etc).
286 static void FormatTitleForDisplay(string16* title); 286 static void FormatTitleForDisplay(string16* title);
287 287
288 // OnBeforeUnload handling ////////////////////////////////////////////////// 288 // OnBeforeUnload handling //////////////////////////////////////////////////
289 289
290 // Gives beforeunload handlers the chance to cancel the close. 290 // Gives beforeunload handlers the chance to cancel the close.
291 bool ShouldCloseWindow(); 291 bool ShouldCloseWindow();
292 292
293 // Figure out if there are tabs that have beforeunload handlers.
294 // It starts beforeunload/unload processing as a side-effect.
295 bool TabsNeedBeforeUnloadFired();
296
297 // Returns true if all tabs' beforeunload/unload events have fired.
298 bool HasCompletedUnloadProcessing() const;
299
300 bool IsAttemptingToCloseBrowser() const; 293 bool IsAttemptingToCloseBrowser() const;
301 294
302 // Invoked when the window containing us is closing. Performs the necessary 295 // Invoked when the window containing us is closing. Performs the necessary
303 // cleanup. 296 // cleanup.
304 void OnWindowClosing(); 297 void OnWindowClosing();
305 298
306 // Called when all unload processing completes so the browser can close.
307 void OnUnloadProcessingCompleted();
308
309 // OnWindowActivationChanged handling /////////////////////////////////////// 299 // OnWindowActivationChanged handling ///////////////////////////////////////
310 300
311 // Invoked when the window containing us is activated. 301 // Invoked when the window containing us is activated.
312 void OnWindowActivated(); 302 void OnWindowActivated();
313 303
314 // In-progress download termination handling ///////////////////////////////// 304 // In-progress download termination handling /////////////////////////////////
315 305
316 // Called when the user has decided whether to proceed or not with the browser 306 // 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 307 // 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 308 // and the browser closed, false if the browser should stay open and the
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Overridden from content::WebContentsDelegate: 425 // Overridden from content::WebContentsDelegate:
436 virtual bool CanOverscrollContent() const OVERRIDE; 426 virtual bool CanOverscrollContent() const OVERRIDE;
437 virtual bool PreHandleKeyboardEvent( 427 virtual bool PreHandleKeyboardEvent(
438 content::WebContents* source, 428 content::WebContents* source,
439 const content::NativeWebKeyboardEvent& event, 429 const content::NativeWebKeyboardEvent& event,
440 bool* is_keyboard_shortcut) OVERRIDE; 430 bool* is_keyboard_shortcut) OVERRIDE;
441 virtual void HandleKeyboardEvent( 431 virtual void HandleKeyboardEvent(
442 content::WebContents* source, 432 content::WebContents* source,
443 const content::NativeWebKeyboardEvent& event) OVERRIDE; 433 const content::NativeWebKeyboardEvent& event) OVERRIDE;
444 434
435 // Figure out if there are tabs that have beforeunload handlers.
436 bool TabsNeedBeforeUnloadFired();
437
445 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } 438 bool is_type_tabbed() const { return type_ == TYPE_TABBED; }
446 bool is_type_popup() const { return type_ == TYPE_POPUP; } 439 bool is_type_popup() const { return type_ == TYPE_POPUP; }
447 440
448 bool is_app() const; 441 bool is_app() const;
449 bool is_devtools() const; 442 bool is_devtools() const;
450 443
451 // True when the mouse cursor is locked. 444 // True when the mouse cursor is locked.
452 bool IsMouseLocked() const; 445 bool IsMouseLocked() const;
453 446
454 // Called each time the browser window is shown. 447 // Called each time the browser window is shown.
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 bool window_has_shown_; 918 bool window_has_shown_;
926 919
927 // Currently open color chooser. Non-NULL after OpenColorChooser is called and 920 // Currently open color chooser. Non-NULL after OpenColorChooser is called and
928 // before DidEndColorChooser is called. 921 // before DidEndColorChooser is called.
929 scoped_ptr<content::ColorChooser> color_chooser_; 922 scoped_ptr<content::ColorChooser> color_chooser_;
930 923
931 DISALLOW_COPY_AND_ASSIGN(Browser); 924 DISALLOW_COPY_AND_ASSIGN(Browser);
932 }; 925 };
933 926
934 #endif // CHROME_BROWSER_UI_BROWSER_H_ 927 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698