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

Side by Side Diff: components/component_updater/updater_state_win.h

Issue 2286483002: Serialize Google Update state as part of the recovery component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2016 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 COMPONENTS_COMPONENT_UPDATER_UPDATER_STATE_WIN_H_
6 #define COMPONENTS_COMPONENT_UPDATER_UPDATER_STATE_WIN_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/gtest_prod_util.h"
12 #include "base/time/time.h"
13 #include "base/version.h"
14 #include "components/update_client/update_client.h"
15
16 namespace component_updater {
17
18 // TODO(sorin): implement this in terms of
19 // chrome/installer/util/google_update_settings (crbug.com/615187).
20 class UpdaterState {
21 public:
22 static std::unique_ptr<UpdaterState> Create(bool is_machine);
23
24 update_client::InstallerAttributes MakeInstallerAttributes() const;
25
26 private:
27 FRIEND_TEST_ALL_PREFIXES(UpdaterStateTest, MakeInstallerAttributes);
28
29 explicit UpdaterState(bool is_machine);
30
31 // This function is best-effort. It updates the class members with
32 // the relevant values that could be retrieved.
33 void ReadState();
34
35 static base::Version GetGoogleUpdateVersion(bool is_machine);
36 static bool IsAutoupdateCheckEnabled();
37 static bool IsJoinedToDomain();
38 static base::Time GetGoogleUpdateLastStartedAU(bool is_machine);
39 static base::Time GetGoogleUpdateLastChecked(bool is_machine);
40 static base::Time GetGoogleUpdateTimeValue(bool is_machine,
41 const wchar_t* value_name);
42 static int GetChromeUpdatePolicy();
43
44 static std::string NormalizeTimeDelta(const base::TimeDelta& delta);
45
46 bool is_machine_;
47 base::Version google_update_version_;
48 base::Time last_autoupdate_started_;
49 base::Time last_checked_;
50 bool is_joined_to_domain_ = false;
51 bool is_autoupdate_check_enabled_ = false;
52 int chrome_update_policy_ = 0;
53 };
54
55 } // namespace component_updater
56
57 #endif // COMPONENTS_COMPONENT_UPDATER_UPDATER_STATE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698