| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "components/policy/proto/device_management_backend.pb.h" | 48 #include "components/policy/proto/device_management_backend.pb.h" |
| 49 #include "components/strings/grit/components_strings.h" | 49 #include "components/strings/grit/components_strings.h" |
| 50 #include "content/public/browser/web_contents.h" | 50 #include "content/public/browser/web_contents.h" |
| 51 #include "extensions/features/features.h" | 51 #include "extensions/features/features.h" |
| 52 #include "google_apis/gaia/gaia_auth_util.h" | 52 #include "google_apis/gaia/gaia_auth_util.h" |
| 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/active_directory_policy_manager.h" |
| 58 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 59 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.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_active_directory_policy_manager.h" | |
| 63 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 62 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 64 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" | 63 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| 65 #include "chrome/browser/chromeos/settings/install_attributes.h" | 64 #include "chrome/browser/chromeos/settings/install_attributes.h" |
| 66 #include "components/user_manager/user_manager.h" | 65 #include "components/user_manager/user_manager.h" |
| 67 #else | 66 #else |
| 68 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 67 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 69 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 68 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 70 #endif | 69 #endif |
| 71 | 70 |
| 72 #if BUILDFLAG(ENABLE_EXTENSIONS) | 71 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 const user_manager::UserManager* user_manager = | 535 const user_manager::UserManager* user_manager = |
| 537 user_manager::UserManager::Get(); | 536 user_manager::UserManager::Get(); |
| 538 Profile* profile = Profile::FromWebUI(web_ui()); | 537 Profile* profile = Profile::FromWebUI(web_ui()); |
| 539 policy::DeviceLocalAccountPolicyService* local_account_service = | 538 policy::DeviceLocalAccountPolicyService* local_account_service = |
| 540 user_manager->IsLoggedInAsPublicAccount() | 539 user_manager->IsLoggedInAsPublicAccount() |
| 541 ? connector->GetDeviceLocalAccountPolicyService() | 540 ? connector->GetDeviceLocalAccountPolicyService() |
| 542 : nullptr; | 541 : nullptr; |
| 543 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy = | 542 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy = |
| 544 policy::UserPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile( | 543 policy::UserPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile( |
| 545 profile); | 544 profile); |
| 546 policy::UserActiveDirectoryPolicyManager* active_directory_policy = | 545 policy::ActiveDirectoryPolicyManager* active_directory_policy = |
| 547 policy::UserPolicyManagerFactoryChromeOS:: | 546 policy::UserPolicyManagerFactoryChromeOS:: |
| 548 GetActiveDirectoryPolicyManagerForProfile(profile); | 547 GetActiveDirectoryPolicyManagerForProfile(profile); |
| 549 if (local_account_service) { | 548 if (local_account_service) { |
| 550 user_status_provider_ = | 549 user_status_provider_ = |
| 551 base::MakeUnique<DeviceLocalAccountPolicyStatusProvider>( | 550 base::MakeUnique<DeviceLocalAccountPolicyStatusProvider>( |
| 552 user_manager->GetActiveUser()->GetAccountId().GetUserEmail(), | 551 user_manager->GetActiveUser()->GetAccountId().GetUserEmail(), |
| 553 local_account_service); | 552 local_account_service); |
| 554 } else if (user_cloud_policy) { | 553 } else if (user_cloud_policy) { |
| 555 user_status_provider_ = base::MakeUnique<UserCloudPolicyStatusProvider>( | 554 user_status_provider_ = base::MakeUnique<UserCloudPolicyStatusProvider>( |
| 556 user_cloud_policy->core()); | 555 user_cloud_policy->core()); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 } | 815 } |
| 817 | 816 |
| 818 void PolicyUIHandler::OnRefreshPoliciesDone() const { | 817 void PolicyUIHandler::OnRefreshPoliciesDone() const { |
| 819 web_ui()->CallJavascriptFunctionUnsafe("policy.Page.reloadPoliciesDone"); | 818 web_ui()->CallJavascriptFunctionUnsafe("policy.Page.reloadPoliciesDone"); |
| 820 } | 819 } |
| 821 | 820 |
| 822 policy::PolicyService* PolicyUIHandler::GetPolicyService() const { | 821 policy::PolicyService* PolicyUIHandler::GetPolicyService() const { |
| 823 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext( | 822 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext( |
| 824 web_ui()->GetWebContents()->GetBrowserContext())->policy_service(); | 823 web_ui()->GetWebContents()->GetBrowserContext())->policy_service(); |
| 825 } | 824 } |
| OLD | NEW |