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

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

Issue 6882038: Move writing information to the lockbox after registering with the DM server. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reverted some whitespaces. Created 9 years, 8 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) 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/device_policy_identity_strategy.h" 5 #include "chrome/browser/policy/device_policy_identity_strategy.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/cros/cros_library.h" 8 #include "chrome/browser/chromeos/cros/cros_library.h"
9 #include "chrome/browser/chromeos/login/ownership_service.h" 9 #include "chrome/browser/chromeos/login/ownership_service.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void DevicePolicyIdentityStrategy::SetDeviceManagementCredentials( 77 void DevicePolicyIdentityStrategy::SetDeviceManagementCredentials(
78 const std::string& owner_email, 78 const std::string& owner_email,
79 const std::string& device_id, 79 const std::string& device_id,
80 const std::string& device_token) { 80 const std::string& device_token) {
81 username_ = owner_email; 81 username_ = owner_email;
82 device_id_ = device_id; 82 device_id_ = device_id;
83 device_token_ = device_token; 83 device_token_ = device_token;
84 NotifyDeviceTokenChanged(); 84 NotifyDeviceTokenChanged();
85 } 85 }
86 86
87 void DevicePolicyIdentityStrategy::FetchPolicy() {
Mattias Nissler (ping if slow) 2011/04/20 14:32:49 DCHECK(!device_token_.empty())
88 NotifyDeviceTokenChanged();
89 }
90
87 bool DevicePolicyIdentityStrategy::GetCredentials(std::string* username, 91 bool DevicePolicyIdentityStrategy::GetCredentials(std::string* username,
88 std::string* auth_token) { 92 std::string* auth_token) {
89 *username = username_; 93 *username = username_;
90 *auth_token = auth_token_; 94 *auth_token = auth_token_;
91 95
92 return !username->empty() && !auth_token->empty(); 96 return !username->empty() && !auth_token->empty();
93 } 97 }
94 98
95 void DevicePolicyIdentityStrategy::OnDeviceTokenAvailable( 99 void DevicePolicyIdentityStrategy::OnDeviceTokenAvailable(
96 const std::string& token) { 100 const std::string& token) {
97 device_token_ = token; 101 device_token_ = token;
98 NotifyDeviceTokenChanged();
99 } 102 }
100 103
101 } // namespace policy 104 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698