OLD | NEW |
---|---|
1 // Copyright (c) 2011 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/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/net/gaia/token_service.h" | 12 #include "chrome/browser/net/gaia/token_service.h" |
13 #include "chrome/browser/policy/cloud_policy_data_store.h" | |
13 #include "chrome/browser/policy/cloud_policy_provider.h" | 14 #include "chrome/browser/policy/cloud_policy_provider.h" |
14 #include "chrome/browser/policy/cloud_policy_provider_impl.h" | 15 #include "chrome/browser/policy/cloud_policy_provider_impl.h" |
15 #include "chrome/browser/policy/cloud_policy_subsystem.h" | 16 #include "chrome/browser/policy/cloud_policy_subsystem.h" |
16 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 17 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
Joao da Silva
2012/01/03 08:19:02
Nit: not used
Mattias Nissler (ping if slow)
2012/01/03 10:02:45
Done.
| |
17 #include "chrome/browser/policy/configuration_policy_provider.h" | 18 #include "chrome/browser/policy/configuration_policy_provider.h" |
18 #include "chrome/browser/policy/network_configuration_updater.h" | 19 #include "chrome/browser/policy/network_configuration_updater.h" |
19 #include "chrome/browser/policy/user_policy_cache.h" | 20 #include "chrome/browser/policy/user_policy_cache.h" |
20 #include "chrome/browser/policy/user_policy_token_cache.h" | 21 #include "chrome/browser/policy/user_policy_token_cache.h" |
21 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/net/gaia/gaia_constants.h" | 25 #include "chrome/common/net/gaia/gaia_constants.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "content/public/browser/notification_details.h" | 27 #include "content/public/browser/notification_details.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 const CloudPolicyDataStore* | 337 const CloudPolicyDataStore* |
337 BrowserPolicyConnector::GetUserCloudPolicyDataStore() const { | 338 BrowserPolicyConnector::GetUserCloudPolicyDataStore() const { |
338 return user_data_store_.get(); | 339 return user_data_store_.get(); |
339 } | 340 } |
340 | 341 |
341 const ConfigurationPolicyHandlerList* | 342 const ConfigurationPolicyHandlerList* |
342 BrowserPolicyConnector::GetHandlerList() const { | 343 BrowserPolicyConnector::GetHandlerList() const { |
343 return &handler_list_; | 344 return &handler_list_; |
344 } | 345 } |
345 | 346 |
346 CloudPolicyDataStore::UserAffiliation | 347 UserAffiliation BrowserPolicyConnector::GetUserAffiliation( |
347 BrowserPolicyConnector::GetUserAffiliation(const std::string& user_name) { | 348 const std::string& user_name) { |
348 #if defined(OS_CHROMEOS) | 349 #if defined(OS_CHROMEOS) |
349 if (install_attributes_.get()) { | 350 if (install_attributes_.get()) { |
350 size_t pos = user_name.find('@'); | 351 size_t pos = user_name.find('@'); |
351 if (pos != std::string::npos && | 352 if (pos != std::string::npos && |
352 user_name.substr(pos + 1) == install_attributes_->GetDomain()) { | 353 user_name.substr(pos + 1) == install_attributes_->GetDomain()) { |
353 return CloudPolicyDataStore::USER_AFFILIATION_MANAGED; | 354 return USER_AFFILIATION_MANAGED; |
354 } | 355 } |
355 } | 356 } |
356 #endif | 357 #endif |
357 | 358 |
358 return CloudPolicyDataStore::USER_AFFILIATION_NONE; | 359 return USER_AFFILIATION_NONE; |
359 } | 360 } |
360 | 361 |
361 void BrowserPolicyConnector::Observe( | 362 void BrowserPolicyConnector::Observe( |
362 int type, | 363 int type, |
363 const content::NotificationSource& source, | 364 const content::NotificationSource& source, |
364 const content::NotificationDetails& details) { | 365 const content::NotificationDetails& details) { |
365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
366 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { | 367 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { |
367 const TokenService* token_source = | 368 const TokenService* token_source = |
368 content::Source<const TokenService>(source).ptr(); | 369 content::Source<const TokenService>(source).ptr(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 486 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
486 } else { | 487 } else { |
487 return NULL; | 488 return NULL; |
488 } | 489 } |
489 #else | 490 #else |
490 return NULL; | 491 return NULL; |
491 #endif | 492 #endif |
492 } | 493 } |
493 | 494 |
494 } // namespace policy | 495 } // namespace policy |
OLD | NEW |