OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 browser_shutdown::SetTryingToQuit(false); | 270 browser_shutdown::SetTryingToQuit(false); |
271 | 271 |
272 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we | 272 // TODO(viettrungluu): Were we to remove Apple Event handlers above, we |
273 // would have to reinstall them here. http://crbug.com/40861 | 273 // would have to reinstall them here. http://crbug.com/40861 |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { | 277 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { |
278 // Check if the preference is turned on. | 278 // Check if the preference is turned on. |
279 const PrefService* prefs = [self defaultProfile]->GetPrefs(); | 279 const PrefService* prefs = [self defaultProfile]->GetPrefs(); |
280 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) | 280 if (!prefs->GetBoolean(prefs::kConfirmToQuitEnabled)) { |
| 281 confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); |
281 return NSTerminateNow; | 282 return NSTerminateNow; |
| 283 } |
282 | 284 |
283 // If the application is going to terminate as the result of a Cmd+Q | 285 // If the application is going to terminate as the result of a Cmd+Q |
284 // invocation, use the special sauce to prevent accidental quitting. | 286 // invocation, use the special sauce to prevent accidental quitting. |
285 // http://dev.chromium.org/developers/design-documents/confirm-to-quit-experim
ent | 287 // http://dev.chromium.org/developers/design-documents/confirm-to-quit-experim
ent |
286 | 288 |
287 // This logic is only for keyboard-initiated quits. | 289 // This logic is only for keyboard-initiated quits. |
288 if (![ConfirmQuitPanelController eventTriggersFeature:[app currentEvent]]) | 290 if (![ConfirmQuitPanelController eventTriggersFeature:[app currentEvent]]) |
289 return NSTerminateNow; | 291 return NSTerminateNow; |
290 | 292 |
291 return [[ConfirmQuitPanelController sharedController] | 293 return [[ConfirmQuitPanelController sharedController] |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1181 |
1180 } // namespace browser | 1182 } // namespace browser |
1181 | 1183 |
1182 namespace app_controller_mac { | 1184 namespace app_controller_mac { |
1183 | 1185 |
1184 bool IsOpeningNewWindow() { | 1186 bool IsOpeningNewWindow() { |
1185 return g_is_opening_new_window; | 1187 return g_is_opening_new_window; |
1186 } | 1188 } |
1187 | 1189 |
1188 } // namespace app_controller_mac | 1190 } // namespace app_controller_mac |
OLD | NEW |