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

Side by Side Diff: chrome/browser/ui/webui/policy_ui_handler.cc

Issue 2606773002: Setup Chromad user policy plumbing (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « chrome/browser/profiles/profile_impl.cc ('k') | chromeos/dbus/auth_policy_client.cc » ('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/ui/webui/policy_ui_handler.h" 5 #include "chrome/browser/ui/webui/policy_ui_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "ui/base/l10n/l10n_util.h" 53 #include "ui/base/l10n/l10n_util.h"
54 #include "ui/base/l10n/time_format.h" 54 #include "ui/base/l10n/time_format.h"
55 55
56 #if defined(OS_CHROMEOS) 56 #if defined(OS_CHROMEOS)
57 #include "chrome/browser/browser_process_platform_part.h" 57 #include "chrome/browser/browser_process_platform_part.h"
58 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 58 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
59 #include "chrome/browser/chromeos/policy/device_active_directory_policy_manager. h" 59 #include "chrome/browser/chromeos/policy/device_active_directory_policy_manager. h"
60 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" 60 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
61 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" 61 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
62 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 62 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
63 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 63 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h"
64 #include "chrome/browser/chromeos/settings/install_attributes.h" 64 #include "chrome/browser/chromeos/settings/install_attributes.h"
65 #include "components/user_manager/user_manager.h" 65 #include "components/user_manager/user_manager.h"
66 #else 66 #else
67 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 67 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
68 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 68 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
69 #endif 69 #endif
70 70
71 #if BUILDFLAG(ENABLE_EXTENSIONS) 71 #if BUILDFLAG(ENABLE_EXTENSIONS)
72 #include "extensions/browser/extension_registry.h" 72 #include "extensions/browser/extension_registry.h"
73 #include "extensions/common/extension.h" 73 #include "extensions/common/extension.h"
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 policy::DeviceLocalAccountPolicyService* local_account_service = 542 policy::DeviceLocalAccountPolicyService* local_account_service =
543 connector->GetDeviceLocalAccountPolicyService(); 543 connector->GetDeviceLocalAccountPolicyService();
544 if (local_account_service) { 544 if (local_account_service) {
545 user_status_provider_ = 545 user_status_provider_ =
546 base::MakeUnique<DeviceLocalAccountPolicyStatusProvider>( 546 base::MakeUnique<DeviceLocalAccountPolicyStatusProvider>(
547 user_manager->GetActiveUser()->GetAccountId().GetUserEmail(), 547 user_manager->GetActiveUser()->GetAccountId().GetUserEmail(),
548 local_account_service); 548 local_account_service);
549 } 549 }
550 } else { 550 } else {
551 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy_manager = 551 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy_manager =
552 policy::UserCloudPolicyManagerFactoryChromeOS::GetForProfile( 552 policy::UserPolicyManagerFactoryChromeOS::
553 Profile::FromWebUI(web_ui())); 553 GetCloudPolicyManagerForProfile(Profile::FromWebUI(web_ui()));
554 if (user_cloud_policy_manager) { 554 if (user_cloud_policy_manager) {
555 user_status_provider_ = 555 user_status_provider_ =
556 base::MakeUnique<UserPolicyStatusProvider>( 556 base::MakeUnique<UserPolicyStatusProvider>(
557 user_cloud_policy_manager->core()); 557 user_cloud_policy_manager->core());
558 } 558 }
559 } 559 }
560 #else 560 #else
561 policy::UserCloudPolicyManager* user_cloud_policy_manager = 561 policy::UserCloudPolicyManager* user_cloud_policy_manager =
562 policy::UserCloudPolicyManagerFactory::GetForBrowserContext( 562 policy::UserCloudPolicyManagerFactory::GetForBrowserContext(
563 web_ui()->GetWebContents()->GetBrowserContext()); 563 web_ui()->GetWebContents()->GetBrowserContext());
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 } 814 }
815 815
816 void PolicyUIHandler::OnRefreshPoliciesDone() const { 816 void PolicyUIHandler::OnRefreshPoliciesDone() const {
817 web_ui()->CallJavascriptFunctionUnsafe("policy.Page.reloadPoliciesDone"); 817 web_ui()->CallJavascriptFunctionUnsafe("policy.Page.reloadPoliciesDone");
818 } 818 }
819 819
820 policy::PolicyService* PolicyUIHandler::GetPolicyService() const { 820 policy::PolicyService* PolicyUIHandler::GetPolicyService() const {
821 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext( 821 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext(
822 web_ui()->GetWebContents()->GetBrowserContext())->policy_service(); 822 web_ui()->GetWebContents()->GetBrowserContext())->policy_service();
823 } 823 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chromeos/dbus/auth_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698