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

Side by Side Diff: chrome/browser/chromeos/policy/user_active_directory_policy_manager.cc

Issue 2623203005: Chromad: Trigger user/device policy fetch on login/reboot (Closed)
Patch Set: Created 3 years, 11 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 #include "chrome/browser/chromeos/policy/user_active_directory_policy_manager.h" 5 #include "chrome/browser/chromeos/policy/user_active_directory_policy_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 17 matching lines...) Expand all
28 void UserActiveDirectoryPolicyManager::Init(SchemaRegistry* registry) { 28 void UserActiveDirectoryPolicyManager::Init(SchemaRegistry* registry) {
29 ConfigurationPolicyProvider::Init(registry); 29 ConfigurationPolicyProvider::Init(registry);
30 30
31 store_->AddObserver(this); 31 store_->AddObserver(this);
32 if (!store_->is_initialized()) { 32 if (!store_->is_initialized()) {
33 store_->Load(); 33 store_->Load();
34 } 34 }
35 35
36 // Does nothing if |store_| hasn't yet initialized. 36 // Does nothing if |store_| hasn't yet initialized.
37 PublishPolicy(); 37 PublishPolicy();
38
39 RefreshPolicies();
38 } 40 }
39 41
40 void UserActiveDirectoryPolicyManager::Shutdown() { 42 void UserActiveDirectoryPolicyManager::Shutdown() {
41 store_->RemoveObserver(this); 43 store_->RemoveObserver(this);
42 ConfigurationPolicyProvider::Shutdown(); 44 ConfigurationPolicyProvider::Shutdown();
43 } 45 }
44 46
45 bool UserActiveDirectoryPolicyManager::IsInitializationComplete( 47 bool UserActiveDirectoryPolicyManager::IsInitializationComplete(
46 PolicyDomain domain) const { 48 PolicyDomain domain) const {
47 if (domain == POLICY_DOMAIN_CHROME) 49 if (domain == POLICY_DOMAIN_CHROME)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 void UserActiveDirectoryPolicyManager::OnPolicyRefreshed(bool success) { 98 void UserActiveDirectoryPolicyManager::OnPolicyRefreshed(bool success) {
97 if (!success) { 99 if (!success) {
98 LOG(ERROR) << "Active Directory policy refresh failed."; 100 LOG(ERROR) << "Active Directory policy refresh failed.";
99 } 101 }
100 // Load independently of success or failure to keep up to date with whatever 102 // Load independently of success or failure to keep up to date with whatever
101 // has happened on the authpolicyd / session manager side. 103 // has happened on the authpolicyd / session manager side.
102 store_->Load(); 104 store_->Load();
103 } 105 }
104 106
105 } // namespace policy 107 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698