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

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

Issue 7466033: Fix warning prompting on closing a window that will cancel downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unneeded friend decls and tweaked a comment. Created 9 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // what the user has done. 105 // what the user has done.
106 MAXIMIZED_STATE_DEFAULT, 106 MAXIMIZED_STATE_DEFAULT,
107 107
108 // Maximized state is explicitly maximized. 108 // Maximized state is explicitly maximized.
109 MAXIMIZED_STATE_MAXIMIZED, 109 MAXIMIZED_STATE_MAXIMIZED,
110 110
111 // Maximized state is explicitly not maximized (normal). 111 // Maximized state is explicitly not maximized (normal).
112 MAXIMIZED_STATE_UNMAXIMIZED 112 MAXIMIZED_STATE_UNMAXIMIZED
113 }; 113 };
114 114
115 // The context for a download blocked notification from
116 // OkToCloseWithInProgressDownloads; part of that function's interface.
sky 2011/07/21 20:08:11 The last fragment of this sentence doesn't make se
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Removed. What I was trying to say was just "this
117 enum DownloadClosePreventionType {
118 // All downloads would be canceled.
119 BROWSER_SHUTDOWN,
sky 2011/07/21 20:08:11 Can you prefix this with something to make it clea
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Done.
120
121 // Downloas associated with this incognito profile would be canceled.
jennb 2011/07/21 18:35:33 typo - Downloas
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Done.
122 LAST_WINDOW_IN_INCOGNITO_PROFILE,
123 };
124
115 struct CreateParams { 125 struct CreateParams {
116 CreateParams(Type type, Profile* profile); 126 CreateParams(Type type, Profile* profile);
117 127
118 // The browser type. 128 // The browser type.
119 Type type; 129 Type type;
120 130
121 // The associated profile. 131 // The associated profile.
122 Profile* profile; 132 Profile* profile;
123 133
124 // The application name that is also the name of the window to the shell. 134 // The application name that is also the name of the window to the shell.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // cleanup. 345 // cleanup.
336 void OnWindowClosing(); 346 void OnWindowClosing();
337 347
338 // OnWindowActivationChanged handling /////////////////////////////////////// 348 // OnWindowActivationChanged handling ///////////////////////////////////////
339 349
340 // Invoked when the window containing us is activated. 350 // Invoked when the window containing us is activated.
341 void OnWindowActivated(); 351 void OnWindowActivated();
342 352
343 // In-progress download termination handling ///////////////////////////////// 353 // In-progress download termination handling /////////////////////////////////
344 354
345 // Are normal and/or incognito downloads in progress? 355 // How many downloads are in process globally, and on this window's profile?
346 void CheckDownloadsInProgress(bool* normal_downloads, 356 void CheckDownloadsInProgress(int* total_download_count,
347 bool* incognito_downloads); 357 int* profile_download_count) const;
348 358
349 // Called when the user has decided whether to proceed or not with the browser 359 // Called when the user has decided whether to proceed or not with the browser
350 // closure. |cancel_downloads| is true if the downloads should be canceled 360 // closure. |cancel_downloads| is true if the downloads should be canceled
351 // and the browser closed, false if the browser should stay open and the 361 // and the browser closed, false if the browser should stay open and the
352 // downloads running. 362 // downloads running.
353 void InProgressDownloadResponse(bool cancel_downloads); 363 void InProgressDownloadResponse(bool cancel_downloads);
354 364
365 // Indicates whether or not this browser window can be closed, or
366 // would be blocked by in-progress downloads.
367 // Returns |true| if no executing downloads would be cancelled by this
368 // window close. If executing downloads would be cancelled by this
369 // window close, then |*type| is updated with the type of close this
370 // is, and |*num_downloads_blocking| is updated with how many downloads
371 // would be canceled if the close continued.
372 bool OkToCloseWithInProgressDownloads(DownloadClosePreventionType* type,
sky 2011/07/21 20:08:11 It's a little bizarre to have both a boolean retur
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Whoops, not sure how I missed that. Right you are
373 int* num_downloads_blocking) const;
374
355 // TabStripModel pass-thrus ///////////////////////////////////////////////// 375 // TabStripModel pass-thrus /////////////////////////////////////////////////
356 376
357 TabStripModel* tabstrip_model() const { 377 TabStripModel* tabstrip_model() const {
358 // TODO(beng): remove this accessor. It violates google style. 378 // TODO(beng): remove this accessor. It violates google style.
359 return tab_handler_->GetTabStripModel(); 379 return tab_handler_->GetTabStripModel();
360 } 380 }
361 381
362 int tab_count() const; 382 int tab_count() const;
363 int active_index() const; 383 int active_index() const;
364 int GetIndexOfController(const NavigationController* controller) const; 384 int GetIndexOfController(const NavigationController* controller) const;
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 1282
1263 scoped_ptr<InstantController> instant_; 1283 scoped_ptr<InstantController> instant_;
1264 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; 1284 scoped_ptr<InstantUnloadHandler> instant_unload_handler_;
1265 1285
1266 BookmarkBar::State bookmark_bar_state_; 1286 BookmarkBar::State bookmark_bar_state_;
1267 1287
1268 DISALLOW_COPY_AND_ASSIGN(Browser); 1288 DISALLOW_COPY_AND_ASSIGN(Browser);
1269 }; 1289 };
1270 1290
1271 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1291 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698