| 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 "apps/app_window_registry_util.h" |
| 8 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/mac/foundation_util.h" | 13 #include "base/mac/foundation_util.h" |
| 13 #include "base/mac/mac_util.h" | 14 #include "base/mac/mac_util.h" |
| 14 #include "base/mac/sdk_forward_declarations.h" | 15 #include "base/mac/sdk_forward_declarations.h" |
| 15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 16 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| 17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #include "chrome/grit/chromium_strings.h" | 80 #include "chrome/grit/chromium_strings.h" |
| 80 #include "chrome/grit/generated_resources.h" | 81 #include "chrome/grit/generated_resources.h" |
| 81 #include "components/signin/core/browser/signin_manager.h" | 82 #include "components/signin/core/browser/signin_manager.h" |
| 82 #include "components/signin/core/common/profile_management_switches.h" | 83 #include "components/signin/core/common/profile_management_switches.h" |
| 83 #include "content/public/browser/browser_thread.h" | 84 #include "content/public/browser/browser_thread.h" |
| 84 #include "content/public/browser/download_manager.h" | 85 #include "content/public/browser/download_manager.h" |
| 85 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
| 86 #include "content/public/browser/notification_types.h" | 87 #include "content/public/browser/notification_types.h" |
| 87 #include "content/public/browser/plugin_service.h" | 88 #include "content/public/browser/plugin_service.h" |
| 88 #include "content/public/browser/user_metrics.h" | 89 #include "content/public/browser/user_metrics.h" |
| 89 #include "extensions/browser/app_window/app_window_registry.h" | |
| 90 #include "extensions/browser/extension_system.h" | 90 #include "extensions/browser/extension_system.h" |
| 91 #include "net/base/filename_util.h" | 91 #include "net/base/filename_util.h" |
| 92 #include "ui/base/cocoa/focus_window_set.h" | 92 #include "ui/base/cocoa/focus_window_set.h" |
| 93 #include "ui/base/l10n/l10n_util.h" | 93 #include "ui/base/l10n/l10n_util.h" |
| 94 #include "ui/base/l10n/l10n_util_mac.h" | 94 #include "ui/base/l10n/l10n_util_mac.h" |
| 95 | 95 |
| 96 using base::UserMetricsAction; | 96 using base::UserMetricsAction; |
| 97 using content::BrowserContext; | 97 using content::BrowserContext; |
| 98 using content::BrowserThread; | 98 using content::BrowserThread; |
| 99 using content::DownloadManager; | 99 using content::DownloadManager; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 browser_shutdown::SetTryingToQuit(false); | 426 browser_shutdown::SetTryingToQuit(false); |
| 427 | 427 |
| 428 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we | 428 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we |
| 429 // would have to reinstall them here. http://crbug.com/40861 | 429 // would have to reinstall them here. http://crbug.com/40861 |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { | 433 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { |
| 434 // If there are no windows, quit immediately. | 434 // If there are no windows, quit immediately. |
| 435 if (chrome::BrowserIterator().done() && | 435 if (chrome::BrowserIterator().done() && |
| 436 !extensions::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0)) { | 436 !apps::AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0)) { |
| 437 return NSTerminateNow; | 437 return NSTerminateNow; |
| 438 } | 438 } |
| 439 | 439 |
| 440 // Check if the preference is turned on. | 440 // Check if the preference is turned on. |
| 441 const PrefService* prefs = g_browser_process->local_state(); | 441 const PrefService* prefs = g_browser_process->local_state(); |
| 442 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { | 442 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { |
| 443 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); | 443 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); |
| 444 return NSTerminateNow; | 444 return NSTerminateNow; |
| 445 } | 445 } |
| 446 | 446 |
| (...skipping 1132 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 |