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

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: Parallel view cleanup to gtk. 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.
117 enum DownloadClosePreventionType {
118 // Browser close is not blocked by download state.
119 DOWNLOAD_CLOSE_OK,
120
121 // The browser is shutting down and there are active downloads
122 // that would be cancelled.
123 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN,
124
125 // There are active downloads associated with this incognito profile
126 // that would be canceled.
127 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE,
128 };
129
115 struct CreateParams { 130 struct CreateParams {
116 CreateParams(Type type, Profile* profile); 131 CreateParams(Type type, Profile* profile);
117 132
118 // The browser type. 133 // The browser type.
119 Type type; 134 Type type;
120 135
121 // The associated profile. 136 // The associated profile.
122 Profile* profile; 137 Profile* profile;
123 138
124 // The application name that is also the name of the window to the shell. 139 // 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. 350 // cleanup.
336 void OnWindowClosing(); 351 void OnWindowClosing();
337 352
338 // OnWindowActivationChanged handling /////////////////////////////////////// 353 // OnWindowActivationChanged handling ///////////////////////////////////////
339 354
340 // Invoked when the window containing us is activated. 355 // Invoked when the window containing us is activated.
341 void OnWindowActivated(); 356 void OnWindowActivated();
342 357
343 // In-progress download termination handling ///////////////////////////////// 358 // In-progress download termination handling /////////////////////////////////
344 359
345 // Are normal and/or incognito downloads in progress?
346 void CheckDownloadsInProgress(bool* normal_downloads,
347 bool* incognito_downloads);
348
349 // Called when the user has decided whether to proceed or not with the browser 360 // 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 361 // 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 362 // and the browser closed, false if the browser should stay open and the
352 // downloads running. 363 // downloads running.
353 void InProgressDownloadResponse(bool cancel_downloads); 364 void InProgressDownloadResponse(bool cancel_downloads);
354 365
366 // Indicates whether or not this browser window can be closed, or
367 // would be blocked by in-progress downloads.
368 // If executing downloads would be cancelled by this window close,
369 // then |*num_downloads_blocking| is updated with how many downloads
370 // would be canceled if the close continued.
371 DownloadClosePreventionType OkToCloseWithInProgressDownloads(
372 int* num_downloads_blocking) const;
373
355 // TabStripModel pass-thrus ///////////////////////////////////////////////// 374 // TabStripModel pass-thrus /////////////////////////////////////////////////
356 375
357 TabStripModel* tabstrip_model() const { 376 TabStripModel* tabstrip_model() const {
358 // TODO(beng): remove this accessor. It violates google style. 377 // TODO(beng): remove this accessor. It violates google style.
359 return tab_handler_->GetTabStripModel(); 378 return tab_handler_->GetTabStripModel();
360 } 379 }
361 380
362 int tab_count() const; 381 int tab_count() const;
363 int active_index() const; 382 int active_index() const;
364 int GetIndexOfController(const NavigationController* controller) const; 383 int GetIndexOfController(const NavigationController* controller) const;
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 1281
1263 scoped_ptr<InstantController> instant_; 1282 scoped_ptr<InstantController> instant_;
1264 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; 1283 scoped_ptr<InstantUnloadHandler> instant_unload_handler_;
1265 1284
1266 BookmarkBar::State bookmark_bar_state_; 1285 BookmarkBar::State bookmark_bar_state_;
1267 1286
1268 DISALLOW_COPY_AND_ASSIGN(Browser); 1287 DISALLOW_COPY_AND_ASSIGN(Browser);
1269 }; 1288 };
1270 1289
1271 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1290 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698