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

Side by Side Diff: remoting/host/policy_hack/policy_watcher_mac.mm

Issue 10816036: [Chromoting] Add a host domain policy to the PolicyWatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to match r148833. Created 8 years, 4 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 #include "remoting/host/policy_hack/policy_watcher.h" 5 #include "remoting/host/policy_hack/policy_watcher.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::mac::ScopedCFTypeRef<CFStringRef> policy_key( 49 base::mac::ScopedCFTypeRef<CFStringRef> policy_key(
50 base::SysUTF8ToCFStringRef(policy_name)); 50 base::SysUTF8ToCFStringRef(policy_name));
51 Boolean valid = false; 51 Boolean valid = false;
52 bool allowed = CFPreferencesGetAppBooleanValue(policy_key, 52 bool allowed = CFPreferencesGetAppBooleanValue(policy_key,
53 policy_bundle_id, 53 policy_bundle_id,
54 &valid); 54 &valid);
55 if (valid) { 55 if (valid) {
56 policy.SetBoolean(policy_name, allowed); 56 policy.SetBoolean(policy_name, allowed);
57 } 57 }
58 } 58 }
59 // TODO(simonmorris): Read policies whose names are in kStringPolicyNames.
59 } 60 }
60 61
61 // Set policy. Policy must be set (even if it is empty) so that the 62 // Set policy. Policy must be set (even if it is empty) so that the
62 // default policy is picked up the first time reload is called. 63 // default policy is picked up the first time reload is called.
63 UpdatePolicies(&policy); 64 UpdatePolicies(&policy);
64 65
65 // Reschedule task. 66 // Reschedule task.
66 ScheduleFallbackReloadTask(); 67 ScheduleFallbackReloadTask();
67 } 68 }
68 }; 69 };
69 70
70 PolicyWatcher* PolicyWatcher::Create( 71 PolicyWatcher* PolicyWatcher::Create(
71 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 72 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
72 return new PolicyWatcherMac(task_runner); 73 return new PolicyWatcherMac(task_runner);
73 } 74 }
74 75
75 } // namespace policy_hack 76 } // namespace policy_hack
76 } // namespace remoting 77 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.cc ('k') | remoting/host/policy_hack/policy_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698