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

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

Issue 667123002: Standardize usage of virtual/override/final in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « remoting/host/policy_hack/fake_policy_watcher.h ('k') | remoting/host/posix/signal_handler.cc » ('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) 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/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 10 matching lines...) Expand all
21 // practice on the Mac that the user must logout/login for policies to be 21 // practice on the Mac that the user must logout/login for policies to be
22 // applied. This will actually pick up policies every 22 // applied. This will actually pick up policies every
23 // |kFallbackReloadDelayMinutes| which is sufficient for right now. 23 // |kFallbackReloadDelayMinutes| which is sufficient for right now.
24 class PolicyWatcherMac : public PolicyWatcher { 24 class PolicyWatcherMac : public PolicyWatcher {
25 public: 25 public:
26 explicit PolicyWatcherMac( 26 explicit PolicyWatcherMac(
27 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 27 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
28 : PolicyWatcher(task_runner) { 28 : PolicyWatcher(task_runner) {
29 } 29 }
30 30
31 virtual ~PolicyWatcherMac() { 31 ~PolicyWatcherMac() override {}
32 }
33 32
34 protected: 33 protected:
35 virtual void StartWatchingInternal() override { 34 void StartWatchingInternal() override { Reload(); }
36 Reload();
37 }
38 35
39 virtual void StopWatchingInternal() override { 36 void StopWatchingInternal() override {}
40 }
41 37
42 virtual void Reload() override { 38 void Reload() override {
43 DCHECK(OnPolicyWatcherThread()); 39 DCHECK(OnPolicyWatcherThread());
44 base::DictionaryValue policy; 40 base::DictionaryValue policy;
45 41
46 CFStringRef policy_bundle_id = CFSTR("com.google.Chrome"); 42 CFStringRef policy_bundle_id = CFSTR("com.google.Chrome");
47 if (CFPreferencesAppSynchronize(policy_bundle_id)) { 43 if (CFPreferencesAppSynchronize(policy_bundle_id)) {
48 for (base::DictionaryValue::Iterator i(Defaults()); 44 for (base::DictionaryValue::Iterator i(Defaults());
49 !i.IsAtEnd(); i.Advance()) { 45 !i.IsAtEnd(); i.Advance()) {
50 const std::string& policy_name = i.key(); 46 const std::string& policy_name = i.key();
51 base::ScopedCFTypeRef<CFStringRef> policy_key( 47 base::ScopedCFTypeRef<CFStringRef> policy_key(
52 base::SysUTF8ToCFStringRef(policy_name)); 48 base::SysUTF8ToCFStringRef(policy_name));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 82 }
87 }; 83 };
88 84
89 PolicyWatcher* PolicyWatcher::Create( 85 PolicyWatcher* PolicyWatcher::Create(
90 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 86 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
91 return new PolicyWatcherMac(task_runner); 87 return new PolicyWatcherMac(task_runner);
92 } 88 }
93 89
94 } // namespace policy_hack 90 } // namespace policy_hack
95 } // namespace remoting 91 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/fake_policy_watcher.h ('k') | remoting/host/posix/signal_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698