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

Side by Side Diff: chrome/browser/preferences_mock_mac.cc

Issue 4062002: Dynamic policy refresh support for the Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/map/list/, nits. Created 10 years, 1 month 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 | « chrome/browser/preferences_mock_mac.h ('k') | chrome/chrome_browser.gypi » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/preferences_mock_mac.h" 5 #include "chrome/browser/preferences_mock_mac.h"
6 6
7 MockPreferences::MockPreferences() { 7 MockPreferences::MockPreferences() {
8 values_.reset(CFDictionaryCreateMutable(kCFAllocatorDefault, 8 values_.reset(CFDictionaryCreateMutable(kCFAllocatorDefault,
9 0, 9 0,
10 &kCFTypeDictionaryKeyCallBacks, 10 &kCFTypeDictionaryKeyCallBacks,
11 &kCFTypeDictionaryValueCallBacks)); 11 &kCFTypeDictionaryValueCallBacks));
12 forced_.reset(CFSetCreateMutable(kCFAllocatorDefault, 12 forced_.reset(CFSetCreateMutable(kCFAllocatorDefault,
13 0, 13 0,
14 &kCFTypeSetCallBacks)); 14 &kCFTypeSetCallBacks));
15 } 15 }
16 16
17 MockPreferences::~MockPreferences() { 17 MockPreferences::~MockPreferences() {
18 } 18 }
19 19
20 Boolean MockPreferences::AppSynchronize(CFStringRef applicationID) {
21 return true;
22 }
20 23
21 CFPropertyListRef MockPreferences::CopyAppValue(CFStringRef key, 24 CFPropertyListRef MockPreferences::CopyAppValue(CFStringRef key,
22 CFStringRef applicationID) { 25 CFStringRef applicationID) {
23 CFPropertyListRef value; 26 CFPropertyListRef value;
24 Boolean found = CFDictionaryGetValueIfPresent(values_, 27 Boolean found = CFDictionaryGetValueIfPresent(values_,
25 key, 28 key,
26 &value); 29 &value);
27 if (!found || !value) 30 if (!found || !value)
28 return NULL; 31 return NULL;
29 CFRetain(value); 32 CFRetain(value);
30 return value; 33 return value;
31 } 34 }
32 35
33 Boolean MockPreferences::AppValueIsForced(CFStringRef key, 36 Boolean MockPreferences::AppValueIsForced(CFStringRef key,
34 CFStringRef applicationID) { 37 CFStringRef applicationID) {
35 return CFSetContainsValue(forced_, key); 38 return CFSetContainsValue(forced_, key);
36 } 39 }
37 40
38 void MockPreferences::AddTestItem(CFStringRef key, 41 void MockPreferences::AddTestItem(CFStringRef key,
39 CFPropertyListRef value, 42 CFPropertyListRef value,
40 bool is_forced) { 43 bool is_forced) {
41 CFDictionarySetValue(values_, key, value); 44 CFDictionarySetValue(values_, key, value);
42 if (is_forced) 45 if (is_forced)
43 CFSetAddValue(forced_, key); 46 CFSetAddValue(forced_, key);
44 } 47 }
OLDNEW
« no previous file with comments | « chrome/browser/preferences_mock_mac.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698