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

Side by Side Diff: chrome/browser/chromeos/login/oauth2_policy_fetcher.cc

Issue 11946017: Remove old cloud policy code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually upload the code I intended to upload. Created 7 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 | 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 "chrome/browser/chromeos/login/oauth2_policy_fetcher.h" 5 #include "chrome/browser/chromeos/login/oauth2_policy_fetcher.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 LOG(ERROR) << "Unrecoverable error or retry count max reached."; 133 LOG(ERROR) << "Unrecoverable error or retry count max reached.";
134 SetPolicyToken(EmptyString()); 134 SetPolicyToken(EmptyString());
135 failed_ = true; 135 failed_ = true;
136 } 136 }
137 137
138 void OAuth2PolicyFetcher::SetPolicyToken(const std::string& token) { 138 void OAuth2PolicyFetcher::SetPolicyToken(const std::string& token) {
139 policy_token_ = token; 139 policy_token_ = token;
140 140
141 policy::BrowserPolicyConnector* browser_policy_connector = 141 policy::BrowserPolicyConnector* browser_policy_connector =
142 g_browser_process->browser_policy_connector(); 142 g_browser_process->browser_policy_connector();
143 browser_policy_connector->RegisterForUserPolicy(token);
144
145 policy::UserCloudPolicyManagerChromeOS* cloud_policy_manager = 143 policy::UserCloudPolicyManagerChromeOS* cloud_policy_manager =
146 browser_policy_connector->GetUserCloudPolicyManager(); 144 browser_policy_connector->GetUserCloudPolicyManager();
147 if (cloud_policy_manager) { 145 if (cloud_policy_manager) {
148 if (token.empty()) 146 if (token.empty())
149 cloud_policy_manager->CancelWaitForPolicyFetch(); 147 cloud_policy_manager->CancelWaitForPolicyFetch();
150 else 148 else
151 cloud_policy_manager->RegisterClient(token); 149 cloud_policy_manager->RegisterClient(token);
152 } 150 }
153 } 151 }
154 152
155 } // namespace chromeos 153 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698