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

Side by Side Diff: chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Fix Clang build and fix bug shown by trybots. Created 7 years, 10 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
OLDNEW
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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #import <QuartzCore/QuartzCore.h> 6 #import <QuartzCore/QuartzCore.h>
7 7
8 #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" 8 #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_nsobject.h" 11 #include "base/memory/scoped_nsobject.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/sys_string_conversions.h" 13 #include "base/sys_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/prefs/pref_registry_simple.h"
15 #include "chrome/browser/prefs/pref_service.h" 16 #include "chrome/browser/prefs/pref_service.h"
Mattias Nissler (ping if slow) 2013/01/31 14:50:45 required?
Jói 2013/01/31 17:29:32 Done.
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/ui/cocoa/confirm_quit.h" 19 #include "chrome/browser/ui/cocoa/confirm_quit.h"
19 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
20 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
21 #import "ui/base/accelerators/platform_accelerator_cocoa.h" 22 #import "ui/base/accelerators/platform_accelerator_cocoa.h"
22 #include "ui/base/l10n/l10n_util_mac.h" 23 #include "ui/base/l10n/l10n_util_mac.h"
23 24
24 // Constants /////////////////////////////////////////////////////////////////// 25 // Constants ///////////////////////////////////////////////////////////////////
25 26
(...skipping 12 matching lines...) Expand all
38 const NSTimeInterval kDoubleTapTimeDelta = 0.32; 39 const NSTimeInterval kDoubleTapTimeDelta = 0.32;
39 40
40 // Functions /////////////////////////////////////////////////////////////////// 41 // Functions ///////////////////////////////////////////////////////////////////
41 42
42 namespace confirm_quit { 43 namespace confirm_quit {
43 44
44 void RecordHistogram(ConfirmQuitMetric sample) { 45 void RecordHistogram(ConfirmQuitMetric sample) {
45 UMA_HISTOGRAM_ENUMERATION("OSX.ConfirmToQuit", sample, kSampleCount); 46 UMA_HISTOGRAM_ENUMERATION("OSX.ConfirmToQuit", sample, kSampleCount);
46 } 47 }
47 48
48 void RegisterLocalState(PrefServiceSimple* local_state) { 49 void RegisterLocalState(PrefRegistrySimple* registry) {
49 local_state->RegisterBooleanPref(prefs::kConfirmToQuitEnabled, false); 50 registry->RegisterBooleanPref(prefs::kConfirmToQuitEnabled, false);
50 } 51 }
51 52
52 } // namespace confirm_quit 53 } // namespace confirm_quit
53 54
54 // Custom Content View ///////////////////////////////////////////////////////// 55 // Custom Content View /////////////////////////////////////////////////////////
55 56
56 // The content view of the window that draws a custom frame. 57 // The content view of the window that draws a custom frame.
57 @interface ConfirmQuitFrameView : NSView { 58 @interface ConfirmQuitFrameView : NSView {
58 @private 59 @private
59 NSTextField* message_; // Weak, owned by the view hierarchy. 60 NSTextField* message_; // Weak, owned by the view hierarchy.
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 if (modifiers & NSAlternateKeyMask) 416 if (modifiers & NSAlternateKeyMask)
416 [string appendString:@"\u2325"]; 417 [string appendString:@"\u2325"];
417 if (modifiers & NSShiftKeyMask) 418 if (modifiers & NSShiftKeyMask)
418 [string appendString:@"\u21E7"]; 419 [string appendString:@"\u21E7"];
419 420
420 [string appendString:[item.characters() uppercaseString]]; 421 [string appendString:[item.characters() uppercaseString]];
421 return string; 422 return string;
422 } 423 }
423 424
424 @end 425 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698