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.h" | 5 #include "chrome/browser/ui/webui/policy_ui.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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 GetPolicyService()->RemoveObserver(policy::POLICY_DOMAIN_EXTENSIONS, this); | 529 GetPolicyService()->RemoveObserver(policy::POLICY_DOMAIN_EXTENSIONS, this); |
530 } | 530 } |
531 | 531 |
532 void PolicyUIHandler::RegisterMessages() { | 532 void PolicyUIHandler::RegisterMessages() { |
533 #if defined(OS_CHROMEOS) | 533 #if defined(OS_CHROMEOS) |
534 policy::BrowserPolicyConnectorChromeOS* connector = | 534 policy::BrowserPolicyConnectorChromeOS* connector = |
535 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 535 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
536 if (connector->IsEnterpriseManaged()) | 536 if (connector->IsEnterpriseManaged()) |
537 device_status_provider_.reset(new DevicePolicyStatusProvider(connector)); | 537 device_status_provider_.reset(new DevicePolicyStatusProvider(connector)); |
538 | 538 |
539 const chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 539 const chromeos::UserManager* user_manager = chromeos::GetUserManager(); |
540 if (user_manager->IsLoggedInAsPublicAccount()) { | 540 if (user_manager->IsLoggedInAsPublicAccount()) { |
541 policy::DeviceLocalAccountPolicyService* local_account_service = | 541 policy::DeviceLocalAccountPolicyService* local_account_service = |
542 connector->GetDeviceLocalAccountPolicyService(); | 542 connector->GetDeviceLocalAccountPolicyService(); |
543 if (local_account_service) { | 543 if (local_account_service) { |
544 user_status_provider_.reset( | 544 user_status_provider_.reset( |
545 new DeviceLocalAccountPolicyStatusProvider( | 545 new DeviceLocalAccountPolicyStatusProvider( |
546 user_manager->GetLoggedInUser()->email(), local_account_service)); | 546 user_manager->GetLoggedInUser()->email(), local_account_service)); |
547 } | 547 } |
548 } else { | 548 } else { |
549 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy_manager = | 549 policy::UserCloudPolicyManagerChromeOS* user_cloud_policy_manager = |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 788 } |
789 | 789 |
790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
791 web_ui->AddMessageHandler(new PolicyUIHandler); | 791 web_ui->AddMessageHandler(new PolicyUIHandler); |
792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
793 CreatePolicyUIHTMLSource()); | 793 CreatePolicyUIHTMLSource()); |
794 } | 794 } |
795 | 795 |
796 PolicyUI::~PolicyUI() { | 796 PolicyUI::~PolicyUI() { |
797 } | 797 } |
OLD | NEW |