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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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) 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"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/policy/async_policy_provider.h" 16 #include "chrome/browser/policy/async_policy_provider.h"
17 #include "chrome/browser/policy/cloud_policy_client.h" 17 #include "chrome/browser/policy/cloud_policy_client.h"
18 #include "chrome/browser/policy/cloud_policy_provider.h" 18 #include "chrome/browser/policy/cloud_policy_provider.h"
19 #include "chrome/browser/policy/cloud_policy_service.h" 19 #include "chrome/browser/policy/cloud_policy_service.h"
20 #include "chrome/browser/policy/cloud_policy_subsystem.h" 20 #include "chrome/browser/policy/cloud_policy_subsystem.h"
21 #include "chrome/browser/policy/configuration_policy_provider.h" 21 #include "chrome/browser/policy/configuration_policy_provider.h"
22 #include "chrome/browser/policy/device_management_service.h" 22 #include "chrome/browser/policy/device_management_service.h"
23 #include "chrome/browser/policy/managed_mode_policy_provider.h" 23 #include "chrome/browser/policy/managed_mode_policy_provider.h"
24 #include "chrome/browser/policy/policy_service_impl.h" 24 #include "chrome/browser/policy/policy_service_impl.h"
25 #include "chrome/browser/policy/policy_statistics_collector.h" 25 #include "chrome/browser/policy/policy_statistics_collector.h"
26 #include "chrome/browser/policy/user_policy_cache.h" 26 #include "chrome/browser/policy/user_policy_cache.h"
27 #include "chrome/browser/policy/user_policy_token_cache.h" 27 #include "chrome/browser/policy/user_policy_token_cache.h"
28 #include "chrome/browser/prefs/pref_service.h"
28 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
29 #include "chrome/browser/signin/token_service.h" 30 #include "chrome/browser/signin/token_service.h"
30 #include "chrome/common/chrome_notification_types.h" 31 #include "chrome/common/chrome_notification_types.h"
31 #include "chrome/common/chrome_paths.h" 32 #include "chrome/common/chrome_paths.h"
32 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/pref_names.h" 34 #include "chrome/common/pref_names.h"
34 #include "content/public/browser/notification_details.h" 35 #include "content/public/browser/notification_details.h"
35 #include "content/public/browser/notification_source.h" 36 #include "content/public/browser/notification_source.h"
36 #include "google_apis/gaia/gaia_auth_util.h" 37 #include "google_apis/gaia/gaia_auth_util.h"
37 #include "google_apis/gaia/gaia_constants.h" 38 #include "google_apis/gaia/gaia_constants.h"
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 if (device_local_account_policy_service_.get()) { 696 if (device_local_account_policy_service_.get()) {
696 device_local_account_policy_service_->Connect( 697 device_local_account_policy_service_->Connect(
697 device_management_service_.get()); 698 device_management_service_.get());
698 } 699 }
699 700
700 SetTimezoneIfPolicyAvailable(); 701 SetTimezoneIfPolicyAvailable();
701 #endif 702 #endif
702 703
703 // TODO: Do not use g_browser_process once policy service is moved to 704 // TODO: Do not use g_browser_process once policy service is moved to
704 // BrowserPolicyConnector (http://crbug.com/128999). 705 // BrowserPolicyConnector (http://crbug.com/128999).
705 policy_statistics_collector_.reset(new policy::PolicyStatisticsCollector( 706 policy_statistics_collector_.reset(
706 g_browser_process->policy_service(), 707 new policy::PolicyStatisticsCollector(
707 g_browser_process->local_state(), 708 g_browser_process->policy_service(),
708 MessageLoop::current()->message_loop_proxy())); 709 g_browser_process->local_state(),
710 MessageLoop::current()->message_loop_proxy()));
709 policy_statistics_collector_->Initialize(); 711 policy_statistics_collector_->Initialize();
710 } 712 }
711 713
712 void BrowserPolicyConnector::SetTimezoneIfPolicyAvailable() { 714 void BrowserPolicyConnector::SetTimezoneIfPolicyAvailable() {
713 #if defined(OS_CHROMEOS) 715 #if defined(OS_CHROMEOS)
714 typedef chromeos::CrosSettingsProvider Provider; 716 typedef chromeos::CrosSettingsProvider Provider;
715 Provider::TrustedStatus result = 717 Provider::TrustedStatus result =
716 chromeos::CrosSettings::Get()->PrepareTrustedValues( 718 chromeos::CrosSettings::Get()->PrepareTrustedValues(
717 base::Bind(&BrowserPolicyConnector::SetTimezoneIfPolicyAvailable, 719 base::Bind(&BrowserPolicyConnector::SetTimezoneIfPolicyAvailable,
718 weak_ptr_factory_.GetWeakPtr())); 720 weak_ptr_factory_.GetWeakPtr()));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 return new AsyncPolicyProvider(loader.Pass()); 780 return new AsyncPolicyProvider(loader.Pass());
779 } else { 781 } else {
780 return NULL; 782 return NULL;
781 } 783 }
782 #else 784 #else
783 return NULL; 785 return NULL;
784 #endif 786 #endif
785 } 787 }
786 788
787 } // namespace policy 789 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/auto_enrollment_client_unittest.cc ('k') | chrome/browser/policy/cloud_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698