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

Side by Side Diff: chrome/browser/chromeos/login/background_view.cc

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by mnissler. Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if (!is_official_build_) { 348 if (!is_official_build_) {
349 boot_times_loader_.GetBootTimes( 349 boot_times_loader_.GetBootTimes(
350 &boot_times_consumer_, 350 &boot_times_consumer_,
351 NewCallback(this, &BackgroundView::OnBootTimes)); 351 NewCallback(this, &BackgroundView::OnBootTimes));
352 } 352 }
353 } else { 353 } else {
354 UpdateVersionLabel(); 354 UpdateVersionLabel();
355 } 355 }
356 356
357 policy::CloudPolicySubsystem* cloud_policy = 357 policy::CloudPolicySubsystem* cloud_policy =
358 g_browser_process->browser_policy_connector()->cloud_policy_subsystem(); 358 g_browser_process->browser_policy_connector()->
359 device_cloud_policy_subsystem();
359 if (cloud_policy) { 360 if (cloud_policy) {
360 // Two-step reset because we want to construct new ObserverRegistrar after 361 // Two-step reset because we want to construct new ObserverRegistrar after
361 // destruction of old ObserverRegistrar to avoid DCHECK violation because 362 // destruction of old ObserverRegistrar to avoid DCHECK violation because
362 // of adding existing observer. 363 // of adding existing observer.
363 cloud_policy_registrar_.reset(); 364 cloud_policy_registrar_.reset();
364 cloud_policy_registrar_.reset( 365 cloud_policy_registrar_.reset(
365 new policy::CloudPolicySubsystem::ObserverRegistrar( 366 new policy::CloudPolicySubsystem::ObserverRegistrar(
366 cloud_policy, this)); 367 cloud_policy, this));
367 368
368 // Ensure that we have up-to-date enterprise info in case enterprise policy 369 // Ensure that we have up-to-date enterprise info in case enterprise policy
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 433
433 os_version_label_->SetText(UTF8ToWide(label_text)); 434 os_version_label_->SetText(UTF8ToWide(label_text));
434 } 435 }
435 436
436 void BackgroundView::UpdateEnterpriseInfo() { 437 void BackgroundView::UpdateEnterpriseInfo() {
437 policy::BrowserPolicyConnector* policy_connector = 438 policy::BrowserPolicyConnector* policy_connector =
438 g_browser_process->browser_policy_connector(); 439 g_browser_process->browser_policy_connector();
439 440
440 std::string status_text; 441 std::string status_text;
441 policy::CloudPolicySubsystem* cloud_policy_subsystem = 442 policy::CloudPolicySubsystem* cloud_policy_subsystem =
442 policy_connector->cloud_policy_subsystem(); 443 policy_connector->device_cloud_policy_subsystem();
443 if (cloud_policy_subsystem) { 444 if (cloud_policy_subsystem) {
444 switch (cloud_policy_subsystem->state()) { 445 switch (cloud_policy_subsystem->state()) {
445 case policy::CloudPolicySubsystem::UNENROLLED: 446 case policy::CloudPolicySubsystem::UNENROLLED:
446 status_text = l10n_util::GetStringUTF8( 447 status_text = l10n_util::GetStringUTF8(
447 IDS_LOGIN_MANAGED_BY_STATUS_PENDING); 448 IDS_LOGIN_MANAGED_BY_STATUS_PENDING);
448 break; 449 break;
449 case policy::CloudPolicySubsystem::UNMANAGED: 450 case policy::CloudPolicySubsystem::UNMANAGED:
450 case policy::CloudPolicySubsystem::BAD_GAIA_TOKEN: 451 case policy::CloudPolicySubsystem::BAD_GAIA_TOKEN:
451 case policy::CloudPolicySubsystem::LOCAL_ERROR: 452 case policy::CloudPolicySubsystem::LOCAL_ERROR:
452 status_text = l10n_util::GetStringUTF8( 453 status_text = l10n_util::GetStringUTF8(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); 511 boot_times_label_->SetText(ASCIIToWide(boot_times_text));
511 } 512 }
512 513
513 void BackgroundView::OnPolicyStateChanged( 514 void BackgroundView::OnPolicyStateChanged(
514 policy::CloudPolicySubsystem::PolicySubsystemState state, 515 policy::CloudPolicySubsystem::PolicySubsystemState state,
515 policy::CloudPolicySubsystem::ErrorDetails error_details) { 516 policy::CloudPolicySubsystem::ErrorDetails error_details) {
516 UpdateEnterpriseInfo(); 517 UpdateEnterpriseInfo();
517 } 518 }
518 519
519 } // namespace chromeos 520 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/chromeos/login/base_login_display_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698