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

Side by Side Diff: chrome/browser/policy/cloud/component_cloud_policy_store.cc

Issue 89243003: Move EmptyString, kWhitespace and the BOM to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/cloud/component_cloud_policy_store.h" 5 #include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (constants) 97 if (constants)
98 *domain = constants->domain; 98 *domain = constants->domain;
99 return constants != NULL; 99 return constants != NULL;
100 } 100 }
101 101
102 const std::string& ComponentCloudPolicyStore::GetCachedHash( 102 const std::string& ComponentCloudPolicyStore::GetCachedHash(
103 const PolicyNamespace& ns) const { 103 const PolicyNamespace& ns) const {
104 DCHECK(CalledOnValidThread()); 104 DCHECK(CalledOnValidThread());
105 std::map<PolicyNamespace, std::string>::const_iterator it = 105 std::map<PolicyNamespace, std::string>::const_iterator it =
106 cached_hashes_.find(ns); 106 cached_hashes_.find(ns);
107 return it == cached_hashes_.end() ? EmptyString() : it->second; 107 return it == cached_hashes_.end() ? base::EmptyString() : it->second;
108 } 108 }
109 109
110 void ComponentCloudPolicyStore::SetCredentials(const std::string& username, 110 void ComponentCloudPolicyStore::SetCredentials(const std::string& username,
111 const std::string& dm_token) { 111 const std::string& dm_token) {
112 DCHECK(CalledOnValidThread()); 112 DCHECK(CalledOnValidThread());
113 DCHECK(username_.empty() || username == username_); 113 DCHECK(username_.empty() || username == username_);
114 DCHECK(dm_token_.empty() || dm_token == dm_token_); 114 DCHECK(dm_token_.empty() || dm_token == dm_token_);
115 username_ = username; 115 username_ = username;
116 dm_token_ = dm_token; 116 dm_token_ = dm_token;
117 } 117 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // If policy for components is ever used for device-level settings then 352 // If policy for components is ever used for device-level settings then
353 // this must support a configurable scope; assuming POLICY_SCOPE_USER is 353 // this must support a configurable scope; assuming POLICY_SCOPE_USER is
354 // fine for now. 354 // fine for now.
355 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL); 355 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL);
356 } 356 }
357 357
358 return true; 358 return true;
359 } 359 }
360 360
361 } // namespace policy 361 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/browser/policy/cloud/mock_device_management_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698