OLD | NEW |
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/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // though.) http://crbug.com/40861 | 386 // though.) http://crbug.com/40861 |
387 | 387 |
388 // Check if the user really wants to quit by employing the confirm-to-quit | 388 // Check if the user really wants to quit by employing the confirm-to-quit |
389 // mechanism. | 389 // mechanism. |
390 if (!browser_shutdown::IsTryingToQuit() && | 390 if (!browser_shutdown::IsTryingToQuit() && |
391 [self applicationShouldTerminate:app] != NSTerminateNow) | 391 [self applicationShouldTerminate:app] != NSTerminateNow) |
392 return NO; | 392 return NO; |
393 | 393 |
394 // Check for active apps. If quitting is prevented, only close browsers and | 394 // Check for active apps. If quitting is prevented, only close browsers and |
395 // sessions. | 395 // sessions. |
396 if (!browser_shutdown::IsTryingToQuit() && | 396 if (!browser_shutdown::IsTryingToQuit() && quitWithAppsController_.get() && |
397 quitWithAppsController_ && !quitWithAppsController_->ShouldQuit()) { | 397 !quitWithAppsController_->ShouldQuit()) { |
398 content::NotificationService::current()->Notify( | 398 content::NotificationService::current()->Notify( |
399 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 399 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
400 content::NotificationService::AllSources(), | 400 content::NotificationService::AllSources(), |
401 content::NotificationService::NoDetails()); | 401 content::NotificationService::NoDetails()); |
402 // This will close all browser sessions. | 402 // This will close all browser sessions. |
403 chrome::CloseAllBrowsers(); | 403 chrome::CloseAllBrowsers(); |
404 return NO; | 404 return NO; |
405 } | 405 } |
406 | 406 |
407 size_t num_browsers = chrome::GetTotalBrowserCount(); | 407 size_t num_browsers = chrome::GetTotalBrowserCount(); |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 | 1579 |
1580 //--------------------------------------------------------------------------- | 1580 //--------------------------------------------------------------------------- |
1581 | 1581 |
1582 namespace app_controller_mac { | 1582 namespace app_controller_mac { |
1583 | 1583 |
1584 bool IsOpeningNewWindow() { | 1584 bool IsOpeningNewWindow() { |
1585 return g_is_opening_new_window; | 1585 return g_is_opening_new_window; |
1586 } | 1586 } |
1587 | 1587 |
1588 } // namespace app_controller_mac | 1588 } // namespace app_controller_mac |
OLD | NEW |