| 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& gaia_token, |
| 104 const std::string& oauth_token) { |
| 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 if (!oauth_token.empty()) |
| 109 device_data_store_->SetOAuthToken(oauth_token); |
| 110 else |
| 111 device_data_store_->SetGaiaToken(gaia_token); |
| 108 } | 112 } |
| 109 #endif | 113 #endif |
| 110 } | 114 } |
| 111 | 115 |
| 112 bool BrowserPolicyConnector::IsEnterpriseManaged() { | 116 bool BrowserPolicyConnector::IsEnterpriseManaged() { |
| 113 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
| 114 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); | 118 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); |
| 115 #else | 119 #else |
| 116 return false; | 120 return false; |
| 117 #endif | 121 #endif |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 379 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
| 376 } else { | 380 } else { |
| 377 return new DummyConfigurationPolicyProvider(policy_list); | 381 return new DummyConfigurationPolicyProvider(policy_list); |
| 378 } | 382 } |
| 379 #else | 383 #else |
| 380 return new DummyConfigurationPolicyProvider(policy_list); | 384 return new DummyConfigurationPolicyProvider(policy_list); |
| 381 #endif | 385 #endif |
| 382 } | 386 } |
| 383 | 387 |
| 384 } // namespace | 388 } // namespace |
| OLD | NEW |