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

Side by Side Diff: chrome/installer/util/package_properties.h

Issue 6288009: More installer refactoring in the interest of fixing some bugs and cleaning t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « chrome/installer/util/package.cc ('k') | chrome/installer/util/package_properties.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_INSTALLER_UTIL_PACKAGE_PROPERTIES_H_
6 #define CHROME_INSTALLER_UTIL_PACKAGE_PROPERTIES_H_
7 #pragma once
8
9 #include <windows.h>
10
11 #include <string>
12
13 #include "base/basictypes.h"
14
15 namespace installer {
16 enum InstallStatus;
17 };
18
19 namespace installer {
20
21 // Pure virtual interface that exposes properties of a package installation.
22 // A package represents a set of binaries on disk that can be shared by two or
23 // more products. Also see the Package class for further details.
24 // PackageProperties is comparable to the BrowserDistribution class but the
25 // difference is that the BrowserDistribution class represents a product
26 // installation whereas PackageProperties represents a package
27 // (horizontal vs vertical).
28 class PackageProperties {
29 public:
30 PackageProperties() {}
31 virtual ~PackageProperties() {}
32
33 static const char kPackageProductName[];
34
35 // Returns true iff this package will be updated by Google Update.
36 virtual bool ReceivesUpdates() const = 0;
37
38 // Equivalent to BrowserDistribution::GetAppGuid()
39 virtual const std::wstring& GetAppGuid() = 0;
40 virtual const std::wstring& GetStateKey() = 0;
41 virtual const std::wstring& GetStateMediumKey() = 0;
42 virtual const std::wstring& GetVersionKey() = 0;
43 virtual void UpdateInstallStatus(bool system_level, bool incremental_install,
44 bool multi_install, installer::InstallStatus status) = 0;
45
46 private:
47 DISALLOW_COPY_AND_ASSIGN(PackageProperties);
48 }; // class PackageProperties
49
50 class PackagePropertiesImpl : public PackageProperties {
51 public:
52 explicit PackagePropertiesImpl(const wchar_t* guid,
53 const std::wstring& state_key,
54 const std::wstring& state_medium_key,
55 const std::wstring& version_key);
56 virtual ~PackagePropertiesImpl();
57
58 virtual const std::wstring& GetAppGuid();
59 virtual const std::wstring& GetStateKey();
60 virtual const std::wstring& GetStateMediumKey();
61 virtual const std::wstring& GetVersionKey();
62 virtual void UpdateInstallStatus(bool system_level, bool incremental_install,
63 bool multi_install, installer::InstallStatus status);
64
65 protected:
66 std::wstring guid_;
67 std::wstring state_key_;
68 std::wstring state_medium_key_;
69 std::wstring version_key_;
70
71 private:
72 DISALLOW_COPY_AND_ASSIGN(PackagePropertiesImpl);
73 }; // class PackagePropertiesImpl
74
75 class ChromiumPackageProperties : public PackagePropertiesImpl {
76 public:
77 ChromiumPackageProperties();
78 virtual ~ChromiumPackageProperties();
79
80 virtual bool ReceivesUpdates() const {
81 return false;
82 }
83
84 private:
85 DISALLOW_COPY_AND_ASSIGN(ChromiumPackageProperties);
86 }; // class ChromiumPackageProperties
87
88 class ChromePackageProperties : public PackagePropertiesImpl {
89 public:
90 ChromePackageProperties();
91 virtual ~ChromePackageProperties();
92
93 virtual bool ReceivesUpdates() const {
94 return true;
95 }
96
97 private:
98 DISALLOW_COPY_AND_ASSIGN(ChromePackageProperties);
99 }; // class ChromePackageProperties
100
101 #if defined(GOOGLE_CHROME_BUILD)
102 typedef ChromePackageProperties ActivePackageProperties;
103 #else
104 typedef ChromiumPackageProperties ActivePackageProperties;
105 #endif
106
107 } // namespace installer
108
109 #endif // CHROME_INSTALLER_UTIL_PACKAGE_PROPERTIES_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/package.cc ('k') | chrome/installer/util/package_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698