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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 browser_shutdown::SetTryingToQuit(false); | 466 browser_shutdown::SetTryingToQuit(false); |
467 | 467 |
468 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we | 468 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we |
469 // would have to reinstall them here. http://crbug.com/40861 | 469 // would have to reinstall them here. http://crbug.com/40861 |
470 } | 470 } |
471 } | 471 } |
472 | 472 |
473 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { | 473 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { |
474 // If there are no windows, quit immediately. | 474 // If there are no windows, quit immediately. |
475 if (chrome::BrowserIterator().done() && | 475 if (chrome::BrowserIterator().done() && |
476 !AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0)) { | 476 !AppWindowRegistryUtil::IsAppWindowVisibleInAnyProfile(0)) { |
477 return NSTerminateNow; | 477 return NSTerminateNow; |
478 } | 478 } |
479 | 479 |
480 // Check if the preference is turned on. | 480 // Check if the preference is turned on. |
481 const PrefService* prefs = g_browser_process->local_state(); | 481 const PrefService* prefs = g_browser_process->local_state(); |
482 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { | 482 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { |
483 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); | 483 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); |
484 return NSTerminateNow; | 484 return NSTerminateNow; |
485 } | 485 } |
486 | 486 |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 | 1743 |
1744 //--------------------------------------------------------------------------- | 1744 //--------------------------------------------------------------------------- |
1745 | 1745 |
1746 namespace app_controller_mac { | 1746 namespace app_controller_mac { |
1747 | 1747 |
1748 bool IsOpeningNewWindow() { | 1748 bool IsOpeningNewWindow() { |
1749 return g_is_opening_new_window; | 1749 return g_is_opening_new_window; |
1750 } | 1750 } |
1751 | 1751 |
1752 } // namespace app_controller_mac | 1752 } // namespace app_controller_mac |
OLD | NEW |