OLD | NEW |
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/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
10 #include "chrome/browser/policy/cloud_policy_data_store.h" | 10 #include "chrome/browser/policy/cloud_policy_data_store.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return recommended_platform_provider_.get(); | 93 return recommended_platform_provider_.get(); |
94 } | 94 } |
95 | 95 |
96 ConfigurationPolicyProvider* | 96 ConfigurationPolicyProvider* |
97 BrowserPolicyConnector::GetRecommendedCloudProvider() const { | 97 BrowserPolicyConnector::GetRecommendedCloudProvider() const { |
98 return recommended_cloud_provider_.get(); | 98 return recommended_cloud_provider_.get(); |
99 } | 99 } |
100 | 100 |
101 void BrowserPolicyConnector::SetDeviceCredentials( | 101 void BrowserPolicyConnector::SetDeviceCredentials( |
102 const std::string& owner_email, | 102 const std::string& owner_email, |
103 const std::string& gaia_token) { | 103 const std::string& token, |
| 104 TokenType token_type) { |
104 #if defined(OS_CHROMEOS) | 105 #if defined(OS_CHROMEOS) |
105 if (device_data_store_.get()) { | 106 if (device_data_store_.get()) { |
106 device_data_store_->set_user_name(owner_email); | 107 device_data_store_->set_user_name(owner_email); |
107 device_data_store_->SetGaiaToken(gaia_token); | 108 switch (token_type) { |
| 109 case TOKEN_TYPE_OAUTH: |
| 110 device_data_store_->SetOAuthToken(token); |
| 111 break; |
| 112 case TOKEN_TYPE_GAIA: |
| 113 device_data_store_->SetGaiaToken(token); |
| 114 break; |
| 115 default: |
| 116 NOTREACHED() << "Invalid token type " << token_type; |
| 117 } |
108 } | 118 } |
109 #endif | 119 #endif |
110 } | 120 } |
111 | 121 |
112 bool BrowserPolicyConnector::IsEnterpriseManaged() { | 122 bool BrowserPolicyConnector::IsEnterpriseManaged() { |
113 #if defined(OS_CHROMEOS) | 123 #if defined(OS_CHROMEOS) |
114 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); | 124 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); |
115 #else | 125 #else |
116 return false; | 126 return false; |
117 #endif | 127 #endif |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 385 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
376 } else { | 386 } else { |
377 return new DummyConfigurationPolicyProvider(policy_list); | 387 return new DummyConfigurationPolicyProvider(policy_list); |
378 } | 388 } |
379 #else | 389 #else |
380 return new DummyConfigurationPolicyProvider(policy_list); | 390 return new DummyConfigurationPolicyProvider(policy_list); |
381 #endif | 391 #endif |
382 } | 392 } |
383 | 393 |
384 } // namespace | 394 } // namespace |
OLD | NEW |