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

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

Issue 10491013: Implement the windows policy provider based on the AsyncPolicyLoader. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comment Created 8 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_loader_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 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/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/common/chrome_paths.h" 26 #include "chrome/common/chrome_paths.h"
27 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
28 #include "chrome/common/net/gaia/gaia_constants.h" 28 #include "chrome/common/net/gaia/gaia_constants.h"
29 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
30 #include "content/public/browser/notification_details.h" 30 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_source.h" 31 #include "content/public/browser/notification_source.h"
32 #include "grit/generated_resources.h" 32 #include "grit/generated_resources.h"
33 #include "policy/policy_constants.h" 33 #include "policy/policy_constants.h"
34 34
35 #if defined(OS_WIN) 35 #if defined(OS_WIN)
36 #include "chrome/browser/policy/configuration_policy_provider_win.h" 36 #include "chrome/browser/policy/policy_loader_win.h"
37 #elif defined(OS_MACOSX) 37 #elif defined(OS_MACOSX)
38 #include "chrome/browser/policy/policy_loader_mac.h" 38 #include "chrome/browser/policy/policy_loader_mac.h"
39 #include "chrome/browser/preferences_mac.h" 39 #include "chrome/browser/preferences_mac.h"
40 #elif defined(OS_POSIX) 40 #elif defined(OS_POSIX)
41 #include "chrome/browser/policy/config_dir_policy_loader.h" 41 #include "chrome/browser/policy/config_dir_policy_loader.h"
42 #endif 42 #endif
43 43
44 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
45 #include "chrome/browser/chromeos/cros/cros_library.h" 45 #include "chrome/browser/chromeos/cros/cros_library.h"
46 #include "chrome/browser/chromeos/system/statistics_provider.h" 46 #include "chrome/browser/chromeos/system/statistics_provider.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 chromeos::system::StatisticsProvider::GetInstance(), 550 chromeos::system::StatisticsProvider::GetInstance(),
551 NULL)); 551 NULL));
552 #endif 552 #endif
553 } 553 }
554 554
555 // static 555 // static
556 ConfigurationPolicyProvider* 556 ConfigurationPolicyProvider*
557 BrowserPolicyConnector::CreatePlatformProvider() { 557 BrowserPolicyConnector::CreatePlatformProvider() {
558 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList(); 558 const PolicyDefinitionList* policy_list = GetChromePolicyDefinitionList();
559 #if defined(OS_WIN) 559 #if defined(OS_WIN)
560 return new ConfigurationPolicyProviderWin(policy_list); 560 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderWin(policy_list));
561 return new AsyncPolicyProvider(policy_list, loader.Pass());
561 #elif defined(OS_MACOSX) 562 #elif defined(OS_MACOSX)
562 scoped_ptr<AsyncPolicyLoader> loader( 563 scoped_ptr<AsyncPolicyLoader> loader(
563 new PolicyLoaderMac(policy_list, new MacPreferences())); 564 new PolicyLoaderMac(policy_list, new MacPreferences()));
564 return new AsyncPolicyProvider(policy_list, loader.Pass()); 565 return new AsyncPolicyProvider(policy_list, loader.Pass());
565 #elif defined(OS_POSIX) 566 #elif defined(OS_POSIX)
566 FilePath config_dir_path; 567 FilePath config_dir_path;
567 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { 568 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) {
568 scoped_ptr<AsyncPolicyLoader> loader( 569 scoped_ptr<AsyncPolicyLoader> loader(
569 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE)); 570 new ConfigDirPolicyLoader(config_dir_path, POLICY_SCOPE_MACHINE));
570 return new AsyncPolicyProvider(policy_list, loader.Pass()); 571 return new AsyncPolicyProvider(policy_list, loader.Pass());
571 } else { 572 } else {
572 return NULL; 573 return NULL;
573 } 574 }
574 #else 575 #else
575 return NULL; 576 return NULL;
576 #endif 577 #endif
577 } 578 }
578 579
579 } // namespace policy 580 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_loader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698