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

Side by Side Diff: chrome/browser/policy/configuration_policy_loader_win.cc

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/policy/configuration_policy_loader_win.h" 5 #include "chrome/browser/policy/configuration_policy_loader_win.h"
6 6
7 #include <userenv.h> 7 #include <userenv.h>
8 8
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 15 matching lines...) Expand all
26 if (!RegisterGPNotification(user_policy_changed_event_.handle(), false)) { 26 if (!RegisterGPNotification(user_policy_changed_event_.handle(), false)) {
27 PLOG(WARNING) << "Failed to register user group policy notification"; 27 PLOG(WARNING) << "Failed to register user group policy notification";
28 user_policy_watcher_failed_ = true; 28 user_policy_watcher_failed_ = true;
29 } 29 }
30 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) { 30 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) {
31 PLOG(WARNING) << "Failed to register machine group policy notification."; 31 PLOG(WARNING) << "Failed to register machine group policy notification.";
32 machine_policy_watcher_failed_ = true; 32 machine_policy_watcher_failed_ = true;
33 } 33 }
34 } 34 }
35 35
36 void ConfigurationPolicyLoaderWin::Reload(bool force) { 36 void ConfigurationPolicyLoaderWin::Reload(const base::Closure& callback,
37 bool force) {
37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
38 // Reset the watches BEFORE reading the individual policies to avoid 39 // Reset the watches BEFORE reading the individual policies to avoid
39 // missing a change notification. 40 // missing a change notification.
40 SetupWatches(); 41 SetupWatches();
41 AsynchronousPolicyLoader::Reload(force); 42 AsynchronousPolicyLoader::Reload(callback, force);
42 } 43 }
43 44
44 void ConfigurationPolicyLoaderWin::InitOnFileThread() { 45 void ConfigurationPolicyLoaderWin::InitOnFileThread() {
45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
46 AsynchronousPolicyLoader::InitOnFileThread(); 47 AsynchronousPolicyLoader::InitOnFileThread();
47 SetupWatches(); 48 SetupWatches();
48 } 49 }
49 50
50 void ConfigurationPolicyLoaderWin::StopOnFileThread() { 51 void ConfigurationPolicyLoaderWin::StopOnFileThread() {
51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
(...skipping 28 matching lines...) Expand all
80 void ConfigurationPolicyLoaderWin::OnObjectSignaled(HANDLE object) { 81 void ConfigurationPolicyLoaderWin::OnObjectSignaled(HANDLE object) {
81 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
82 DCHECK(object == user_policy_changed_event_.handle() || 83 DCHECK(object == user_policy_changed_event_.handle() ||
83 object == machine_policy_changed_event_.handle()) 84 object == machine_policy_changed_event_.handle())
84 << "unexpected object signaled policy reload, obj = " 85 << "unexpected object signaled policy reload, obj = "
85 << std::showbase << std::hex << object; 86 << std::showbase << std::hex << object;
86 Reload(false); 87 Reload(false);
87 } 88 }
88 89
89 } // namespace policy 90 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698