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

Side by Side Diff: ios/chrome/browser/ui/settings/utils/pref_backed_boolean.mm

Issue 2685863005: [ObjC ARC] Converts ios/chrome/browser/ui/settings/utils:utils to ARC. (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h" 5 #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/prefs/pref_member.h" 8 #include "components/prefs/pref_member.h"
9 #include "components/prefs/pref_service.h" 9 #include "components/prefs/pref_service.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 namespace { 15 namespace {
12 16
13 // Adaptor function to allow invoking onChange as a base::Closure. 17 // Adaptor function to allow invoking onChange as a base::Closure.
14 void OnChange(id<ObservableBoolean> object) { 18 void OnChange(id<ObservableBoolean> object) {
15 [object.observer booleanDidChange:object]; 19 [object.observer booleanDidChange:object];
16 } 20 }
17 21
18 } // namespace 22 } // namespace
19 23
20 @implementation PrefBackedBoolean { 24 @implementation PrefBackedBoolean {
(...skipping 19 matching lines...) Expand all
40 44
41 - (BOOL)value { 45 - (BOOL)value {
42 return _pref.GetValue(); 46 return _pref.GetValue();
43 } 47 }
44 48
45 - (void)setValue:(BOOL)value { 49 - (void)setValue:(BOOL)value {
46 _pref.SetValue(value == YES); 50 _pref.SetValue(value == YES);
47 } 51 }
48 52
49 @end 53 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698