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

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 25603004: Leave apps running on Windows and Linux when quitting Chrome from the wrench menu. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.h » ('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 #import "chrome/browser/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include "apps/app_shim/app_shim_mac.h" 7 #include "apps/app_shim/app_shim_mac.h"
8 #include "apps/app_shim/extension_app_shim_handler_mac.h" 8 #include "apps/app_shim/extension_app_shim_handler_mac.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // though.) http://crbug.com/40861 352 // though.) http://crbug.com/40861
353 353
354 // Check if the user really wants to quit by employing the confirm-to-quit 354 // Check if the user really wants to quit by employing the confirm-to-quit
355 // mechanism. 355 // mechanism.
356 if (!browser_shutdown::IsTryingToQuit() && 356 if (!browser_shutdown::IsTryingToQuit() &&
357 [self applicationShouldTerminate:app] != NSTerminateNow) 357 [self applicationShouldTerminate:app] != NSTerminateNow)
358 return NO; 358 return NO;
359 359
360 size_t num_browsers = chrome::GetTotalBrowserCount(); 360 size_t num_browsers = chrome::GetTotalBrowserCount();
361 361
362 // Initiate a shutdown (via chrome::CloseAllBrowsers()) if we aren't 362 // Initiate a shutdown (via chrome::CloseAllBrowsersAndQuit()) if we aren't
363 // already shutting down. 363 // already shutting down.
364 if (!browser_shutdown::IsTryingToQuit()) { 364 if (!browser_shutdown::IsTryingToQuit()) {
365 content::NotificationService::current()->Notify( 365 content::NotificationService::current()->Notify(
366 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, 366 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
367 content::NotificationService::AllSources(), 367 content::NotificationService::AllSources(),
368 content::NotificationService::NoDetails()); 368 content::NotificationService::NoDetails());
369 chrome::CloseAllBrowsers(); 369 chrome::CloseAllBrowsersAndQuit();
370 } 370 }
371 371
372 return num_browsers == 0 ? YES : NO; 372 return num_browsers == 0 ? YES : NO;
373 } 373 }
374 374
375 - (void)stopTryingToTerminateApplication:(NSApplication*)app { 375 - (void)stopTryingToTerminateApplication:(NSApplication*)app {
376 if (browser_shutdown::IsTryingToQuit()) { 376 if (browser_shutdown::IsTryingToQuit()) {
377 // Reset the "trying to quit" state, so that closing all browser windows 377 // Reset the "trying to quit" state, so that closing all browser windows
378 // will no longer lead to termination. 378 // will no longer lead to termination.
379 browser_shutdown::SetTryingToQuit(false); 379 browser_shutdown::SetTryingToQuit(false);
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 1423
1424 //--------------------------------------------------------------------------- 1424 //---------------------------------------------------------------------------
1425 1425
1426 namespace app_controller_mac { 1426 namespace app_controller_mac {
1427 1427
1428 bool IsOpeningNewWindow() { 1428 bool IsOpeningNewWindow() {
1429 return g_is_opening_new_window; 1429 return g_is_opening_new_window;
1430 } 1430 }
1431 1431
1432 } // namespace app_controller_mac 1432 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698