Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 6794030: [Mac] Confirm-to-quit: Add histogram metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/confirm_quit_panel_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/confirm_quit_panel_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698