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

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

Issue 7564028: Added version info to WebUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added boot times label Created 9 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_VERSION_INFO_UPDATER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_VERSION_INFO_UPDATER_H_
7 #pragma once
8
9 #include <string>
10
11 #include "chrome/browser/chromeos/boot_times_loader.h"
12 #include "chrome/browser/chromeos/version_loader.h"
13 #include "chrome/browser/policy/cloud_policy_subsystem.h"
14
15 namespace chromeos {
16
17 // Fetches all info we want to show on OOBE/Login screens about system
18 // version, boot times and cloud policy.
19 class VersionInfoUpdater : policy::CloudPolicySubsystem::Observer {
20 public:
21 class Delegate {
22 public:
23 virtual ~Delegate() {}
24
25 // Called when OS version label should be updated.
26 virtual void OnOSVersionLabelTextUpdated(
27 const std::string& os_version_label_text) = 0;
28
29 // Called when boot times label should be updated.
30 virtual void OnBootTimesLabelTextUpdated(
31 const std::string& boot_times_label_text) = 0;
32 };
33
34 explicit VersionInfoUpdater(Delegate* delegate);
35 virtual ~VersionInfoUpdater();
36
37 // Sets delegate.
38 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
39
40 // Starts fetching version info. The delegate will be notified when update
41 // is received.
42 void StartUpdate(bool is_official_build);
43
44 private:
45 // policy::CloudPolicySubsystem::Observer methods:
46 virtual void OnPolicyStateChanged(
47 policy::CloudPolicySubsystem::PolicySubsystemState state,
48 policy::CloudPolicySubsystem::ErrorDetails error_details) OVERRIDE;
49
50 // Update the version label.
51 void UpdateVersionLabel();
52
53 // Check and update enterprise domain.
54 void UpdateEnterpriseInfo();
55
56 // Set enterprise domain name.
57 void SetEnterpriseInfo(const std::string& domain_name,
58 const std::string& status_text);
59
60 // Callback from chromeos::VersionLoader giving the version.
61 void OnVersion(VersionLoader::Handle handle, std::string version);
62 // Callback from chromeos::InfoLoader giving the boot times.
63 void OnBootTimes(
64 BootTimesLoader::Handle handle, BootTimesLoader::BootTimes boot_times);
65
66 // Handles asynchronously loading the version.
67 VersionLoader version_loader_;
68 // Used to request the version.
69 CancelableRequestConsumer version_consumer_;
70
71 // Handles asynchronously loading the boot times.
72 BootTimesLoader boot_times_loader_;
73 // Used to request the boot times.
74 CancelableRequestConsumer boot_times_consumer_;
75
76 // Information pieces for version label.
77 std::string version_text_;
78 std::string enterprise_domain_text_;
79 std::string enterprise_status_text_;
80
81 // Full text for the OS version label.
82 std::string os_version_label_text_;
83
84 // CloudPolicySubsysterm observer registrar
85 scoped_ptr<policy::CloudPolicySubsystem::ObserverRegistrar>
86 cloud_policy_registrar_;
87
88 Delegate* delegate_;
89
90 DISALLOW_COPY_AND_ASSIGN(VersionInfoUpdater);
91 };
92
93 } // namespace chromeos
94
95 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_VERSION_INFO_UPDATER_H_
96
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | chrome/browser/chromeos/login/version_info_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698