| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h" | 5 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 g_browser_process->notification_ui_manager()->CancelById( | 88 g_browser_process->notification_ui_manager()->CancelById( |
| 89 id(), NotificationUIManager::GetProfileID(notification_profile_)); | 89 id(), NotificationUIManager::GetProfileID(notification_profile_)); |
| 90 if (button_index == kQuitAllAppsButtonIndex) { | 90 if (button_index == kQuitAllAppsButtonIndex) { |
| 91 AppWindowRegistryUtil::CloseAllAppWindows(); | 91 AppWindowRegistryUtil::CloseAllAppWindows(); |
| 92 } else if (button_index == kDontShowAgainButtonIndex) { | 92 } else if (button_index == kDontShowAgainButtonIndex) { |
| 93 g_browser_process->local_state()->SetBoolean( | 93 g_browser_process->local_state()->SetBoolean( |
| 94 prefs::kNotifyWhenAppsKeepChromeAlive, false); | 94 prefs::kNotifyWhenAppsKeepChromeAlive, false); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 content::WebContents* QuitWithAppsController::GetWebContents() const { | |
| 99 return NULL; | |
| 100 } | |
| 101 | |
| 102 std::string QuitWithAppsController::id() const { | 98 std::string QuitWithAppsController::id() const { |
| 103 return kQuitWithAppsNotificationID; | 99 return kQuitWithAppsNotificationID; |
| 104 } | 100 } |
| 105 | 101 |
| 106 bool QuitWithAppsController::ShouldQuit() { | 102 bool QuitWithAppsController::ShouldQuit() { |
| 107 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 103 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 108 | 104 |
| 109 // Quit immediately if this is a test. | 105 // Quit immediately if this is a test. |
| 110 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType) && | 106 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType) && |
| 111 !CommandLine::ForCurrentProcess()->HasSwitch( | 107 !CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 143 |
| 148 // Always return false, the notification UI can be used to quit all apps which | 144 // Always return false, the notification UI can be used to quit all apps which |
| 149 // will cause Chrome to quit. | 145 // will cause Chrome to quit. |
| 150 return false; | 146 return false; |
| 151 } | 147 } |
| 152 | 148 |
| 153 // static | 149 // static |
| 154 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) { | 150 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) { |
| 155 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true); | 151 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true); |
| 156 } | 152 } |
| OLD | NEW |