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

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

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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/version_info_updater.h" 5 #include "chrome/browser/chromeos/login/version_info_updater.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 25 matching lines...) Expand all
36 // VersionInfoUpdater public: 36 // VersionInfoUpdater public:
37 37
38 VersionInfoUpdater::VersionInfoUpdater(Delegate* delegate) 38 VersionInfoUpdater::VersionInfoUpdater(Delegate* delegate)
39 : delegate_(delegate) { 39 : delegate_(delegate) {
40 } 40 }
41 41
42 VersionInfoUpdater::~VersionInfoUpdater() { 42 VersionInfoUpdater::~VersionInfoUpdater() {
43 } 43 }
44 44
45 void VersionInfoUpdater::StartUpdate(bool is_official_build) { 45 void VersionInfoUpdater::StartUpdate(bool is_official_build) {
46 if (CrosLibrary::Get()->EnsureLoaded()) { 46 if (CrosLibrary::Get()->libcros_loaded()) {
satorux1 2011/11/16 23:51:34 The version loadeder doesn't seem to depend on lib
stevenjb 2011/11/17 00:23:33 Will use system::runtime_environment::IsRunningOnC
47 version_loader_.GetVersion( 47 version_loader_.GetVersion(
48 &version_consumer_, 48 &version_consumer_,
49 base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)), 49 base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)),
50 is_official_build ? 50 is_official_build ?
51 VersionLoader::VERSION_SHORT_WITH_DATE : 51 VersionLoader::VERSION_SHORT_WITH_DATE :
52 VersionLoader::VERSION_FULL); 52 VersionLoader::VERSION_FULL);
53 boot_times_loader_.GetBootTimes( 53 boot_times_loader_.GetBootTimes(
54 &boot_times_consumer_, 54 &boot_times_consumer_,
55 NewCallback(this, is_official_build ? 55 NewCallback(this, is_official_build ?
56 &VersionInfoUpdater::OnBootTimesNoop : 56 &VersionInfoUpdater::OnBootTimesNoop :
(...skipping 14 matching lines...) Expand all
71 new policy::CloudPolicySubsystem::ObserverRegistrar( 71 new policy::CloudPolicySubsystem::ObserverRegistrar(
72 cloud_policy, this)); 72 cloud_policy, this));
73 73
74 // Ensure that we have up-to-date enterprise info in case enterprise policy 74 // Ensure that we have up-to-date enterprise info in case enterprise policy
75 // is already fetched and has finished initialization. 75 // is already fetched and has finished initialization.
76 UpdateEnterpriseInfo(); 76 UpdateEnterpriseInfo();
77 } 77 }
78 } 78 }
79 79
80 void VersionInfoUpdater::UpdateVersionLabel() { 80 void VersionInfoUpdater::UpdateVersionLabel() {
81 if (!CrosLibrary::Get()->EnsureLoaded()) { 81 if (!CrosLibrary::Get()->libcros_loaded()) {
satorux1 2011/11/16 23:51:34 ditto.
stevenjb 2011/11/17 00:23:33 ditto.
82 if (delegate_) { 82 if (delegate_) {
83 delegate_->OnOSVersionLabelTextUpdated( 83 delegate_->OnOSVersionLabelTextUpdated(
84 CrosLibrary::Get()->load_error_string()); 84 CrosLibrary::Get()->load_error_string());
85 } 85 }
86 return; 86 return;
87 } 87 }
88 88
89 if (version_text_.empty()) 89 if (version_text_.empty())
90 return; 90 return;
91 91
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); 200 delegate_->OnBootTimesLabelTextUpdated(boot_times_text);
201 } 201 }
202 202
203 void VersionInfoUpdater::OnPolicyStateChanged( 203 void VersionInfoUpdater::OnPolicyStateChanged(
204 policy::CloudPolicySubsystem::PolicySubsystemState state, 204 policy::CloudPolicySubsystem::PolicySubsystemState state,
205 policy::CloudPolicySubsystem::ErrorDetails error_details) { 205 policy::CloudPolicySubsystem::ErrorDetails error_details) {
206 UpdateEnterpriseInfo(); 206 UpdateEnterpriseInfo();
207 } 207 }
208 208
209 } // namespace chromeos 209 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698