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/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/app_window_registry.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/mac/foundation_util.h" | 14 #include "base/mac/foundation_util.h" |
15 #include "base/mac/mac_util.h" | 15 #include "base/mac/mac_util.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/sys_string_conversions.h" | 19 #include "base/strings/sys_string_conversions.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 browser_shutdown::SetTryingToQuit(false); | 410 browser_shutdown::SetTryingToQuit(false); |
411 | 411 |
412 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we | 412 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we |
413 // would have to reinstall them here. http://crbug.com/40861 | 413 // would have to reinstall them here. http://crbug.com/40861 |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { | 417 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { |
418 // If there are no windows, quit immediately. | 418 // If there are no windows, quit immediately. |
419 if (chrome::BrowserIterator().done() && | 419 if (chrome::BrowserIterator().done() && |
420 !apps::ShellWindowRegistry::IsShellWindowRegisteredInAnyProfile(0)) { | 420 !apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0)) { |
421 return NSTerminateNow; | 421 return NSTerminateNow; |
422 } | 422 } |
423 | 423 |
424 // Check if the preference is turned on. | 424 // Check if the preference is turned on. |
425 const PrefService* prefs = g_browser_process->local_state(); | 425 const PrefService* prefs = g_browser_process->local_state(); |
426 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { | 426 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { |
427 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); | 427 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); |
428 return NSTerminateNow; | 428 return NSTerminateNow; |
429 } | 429 } |
430 | 430 |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 | 1516 |
1517 //--------------------------------------------------------------------------- | 1517 //--------------------------------------------------------------------------- |
1518 | 1518 |
1519 namespace app_controller_mac { | 1519 namespace app_controller_mac { |
1520 | 1520 |
1521 bool IsOpeningNewWindow() { | 1521 bool IsOpeningNewWindow() { |
1522 return g_is_opening_new_window; | 1522 return g_is_opening_new_window; |
1523 } | 1523 } |
1524 | 1524 |
1525 } // namespace app_controller_mac | 1525 } // namespace app_controller_mac |
OLD | NEW |