OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/background_view.h" | 5 #include "chrome/browser/chromeos/login/background_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (!is_official_build_) { | 351 if (!is_official_build_) { |
352 boot_times_loader_.GetBootTimes( | 352 boot_times_loader_.GetBootTimes( |
353 &boot_times_consumer_, | 353 &boot_times_consumer_, |
354 NewCallback(this, &BackgroundView::OnBootTimes)); | 354 NewCallback(this, &BackgroundView::OnBootTimes)); |
355 } | 355 } |
356 } else { | 356 } else { |
357 UpdateVersionLabel(); | 357 UpdateVersionLabel(); |
358 } | 358 } |
359 | 359 |
360 policy::CloudPolicySubsystem* cloud_policy = | 360 policy::CloudPolicySubsystem* cloud_policy = |
361 g_browser_process->browser_policy_connector()->cloud_policy_subsystem(); | 361 g_browser_process->browser_policy_connector()-> |
| 362 device_cloud_policy_subsystem(); |
362 if (cloud_policy) { | 363 if (cloud_policy) { |
363 // Two-step reset because we want to construct new ObserverRegistrar after | 364 // Two-step reset because we want to construct new ObserverRegistrar after |
364 // destruction of old ObserverRegistrar to avoid DCHECK violation because | 365 // destruction of old ObserverRegistrar to avoid DCHECK violation because |
365 // of adding existing observer. | 366 // of adding existing observer. |
366 cloud_policy_registrar_.reset(); | 367 cloud_policy_registrar_.reset(); |
367 cloud_policy_registrar_.reset( | 368 cloud_policy_registrar_.reset( |
368 new policy::CloudPolicySubsystem::ObserverRegistrar( | 369 new policy::CloudPolicySubsystem::ObserverRegistrar( |
369 cloud_policy, this)); | 370 cloud_policy, this)); |
370 | 371 |
371 // Ensure that we have up-to-date enterprise info in case enterprise policy | 372 // Ensure that we have up-to-date enterprise info in case enterprise policy |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 442 |
442 os_version_label_->SetText(UTF8ToWide(label_text)); | 443 os_version_label_->SetText(UTF8ToWide(label_text)); |
443 } | 444 } |
444 | 445 |
445 void BackgroundView::UpdateEnterpriseInfo() { | 446 void BackgroundView::UpdateEnterpriseInfo() { |
446 policy::BrowserPolicyConnector* policy_connector = | 447 policy::BrowserPolicyConnector* policy_connector = |
447 g_browser_process->browser_policy_connector(); | 448 g_browser_process->browser_policy_connector(); |
448 | 449 |
449 std::string status_text; | 450 std::string status_text; |
450 policy::CloudPolicySubsystem* cloud_policy_subsystem = | 451 policy::CloudPolicySubsystem* cloud_policy_subsystem = |
451 policy_connector->cloud_policy_subsystem(); | 452 policy_connector->device_cloud_policy_subsystem(); |
452 if (cloud_policy_subsystem) { | 453 if (cloud_policy_subsystem) { |
453 switch (cloud_policy_subsystem->state()) { | 454 switch (cloud_policy_subsystem->state()) { |
454 case policy::CloudPolicySubsystem::UNENROLLED: | 455 case policy::CloudPolicySubsystem::UNENROLLED: |
455 status_text = l10n_util::GetStringUTF8( | 456 status_text = l10n_util::GetStringUTF8( |
456 IDS_LOGIN_MANAGED_BY_STATUS_PENDING); | 457 IDS_LOGIN_MANAGED_BY_STATUS_PENDING); |
457 break; | 458 break; |
458 case policy::CloudPolicySubsystem::UNMANAGED: | 459 case policy::CloudPolicySubsystem::UNMANAGED: |
459 case policy::CloudPolicySubsystem::BAD_GAIA_TOKEN: | 460 case policy::CloudPolicySubsystem::BAD_GAIA_TOKEN: |
460 case policy::CloudPolicySubsystem::LOCAL_ERROR: | 461 case policy::CloudPolicySubsystem::LOCAL_ERROR: |
461 status_text = l10n_util::GetStringUTF8( | 462 status_text = l10n_util::GetStringUTF8( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); | 520 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); |
520 } | 521 } |
521 | 522 |
522 void BackgroundView::OnPolicyStateChanged( | 523 void BackgroundView::OnPolicyStateChanged( |
523 policy::CloudPolicySubsystem::PolicySubsystemState state, | 524 policy::CloudPolicySubsystem::PolicySubsystemState state, |
524 policy::CloudPolicySubsystem::ErrorDetails error_details) { | 525 policy::CloudPolicySubsystem::ErrorDetails error_details) { |
525 UpdateEnterpriseInfo(); | 526 UpdateEnterpriseInfo(); |
526 } | 527 } |
527 | 528 |
528 } // namespace chromeos | 529 } // namespace chromeos |
OLD | NEW |