OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ | 5 #ifndef CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ |
6 #define CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ | 6 #define CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "chrome/installer/mini_installer/mini_string.h" | |
11 | |
10 namespace mini_installer { | 12 namespace mini_installer { |
11 | 13 |
12 // A simple container of the mini_installer's configuration, as dictated by the | 14 // A simple container of the mini_installer's configuration, as dictated by the |
13 // command line used to invoke it. | 15 // command line used to invoke it. |
14 class Configuration { | 16 class Configuration { |
15 public: | 17 public: |
16 enum Operation { | 18 enum Operation { |
17 INSTALL_PRODUCT, | 19 INSTALL_PRODUCT, |
18 CLEANUP, | 20 CLEANUP, |
19 }; | 21 }; |
(...skipping 15 matching lines...) Expand all Loading... | |
35 // the program itself. | 37 // the program itself. |
36 int argument_count() const { return argument_count_; } | 38 int argument_count() const { return argument_count_; } |
37 | 39 |
38 // Returns the original command line. | 40 // Returns the original command line. |
39 const wchar_t* command_line() const { return command_line_; } | 41 const wchar_t* command_line() const { return command_line_; } |
40 | 42 |
41 // Returns the app guid to be used for Chrome. --chrome-sxs on the command | 43 // Returns the app guid to be used for Chrome. --chrome-sxs on the command |
42 // line makes this the canary's app guid. | 44 // line makes this the canary's app guid. |
43 const wchar_t* chrome_app_guid() const { return chrome_app_guid_; } | 45 const wchar_t* chrome_app_guid() const { return chrome_app_guid_; } |
44 | 46 |
47 // Returns the app guid used in as the registry key. | |
robertshield
2015/08/04 03:11:36
Stale comment?
| |
48 | |
45 // Returns true if --chrome is explicitly or implicitly on the command line. | 49 // Returns true if --chrome is explicitly or implicitly on the command line. |
46 bool has_chrome() const { return has_chrome_; } | 50 bool has_chrome() const { return has_chrome_; } |
47 | 51 |
48 // Returns true if --chrome-frame is on the command line. | 52 // Returns true if --chrome-frame is on the command line. |
49 bool has_chrome_frame() const { return has_chrome_frame_; } | 53 bool has_chrome_frame() const { return has_chrome_frame_; } |
50 | 54 |
51 // Returns true if --multi-install is on the command line. | 55 // Returns true if --multi-install is on the command line. |
52 bool is_multi_install() const { return is_multi_install_; } | 56 bool is_multi_install() const { return is_multi_install_; } |
53 | 57 |
54 // Returns true if --system-level is on the command line. | 58 // Returns true if --system-level is on the command line. |
(...skipping 11 matching lines...) Expand all Loading... | |
66 const wchar_t* chrome_app_guid_; | 70 const wchar_t* chrome_app_guid_; |
67 const wchar_t* command_line_; | 71 const wchar_t* command_line_; |
68 int argument_count_; | 72 int argument_count_; |
69 Operation operation_; | 73 Operation operation_; |
70 bool has_chrome_; | 74 bool has_chrome_; |
71 bool has_chrome_frame_; | 75 bool has_chrome_frame_; |
72 bool is_multi_install_; | 76 bool is_multi_install_; |
73 bool is_system_level_; | 77 bool is_system_level_; |
74 const wchar_t* previous_version_; | 78 const wchar_t* previous_version_; |
75 | 79 |
80 protected: | |
81 typedef StackString<128> ValueString; | |
82 | |
83 // Abstract registry access for testing purposes. | |
robertshield
2015/08/04 03:11:36
Nit: Slightly ambiguous use of the word "abstract"
bcwhite
2015/08/04 19:34:30
Done.
| |
84 virtual bool ReadClientStateRegistryValue( | |
85 const HKEY root_key, const wchar_t* app_guid, | |
86 LONG* retval, ValueString& value); | |
87 | |
76 private: | 88 private: |
77 Configuration(const Configuration&); | 89 Configuration(const Configuration&); |
78 Configuration& operator=(const Configuration&); | 90 Configuration& operator=(const Configuration&); |
91 | |
92 void SetChromeAppGuid(); | |
79 }; | 93 }; |
80 | 94 |
81 } // namespace mini_installer | 95 } // namespace mini_installer |
82 | 96 |
83 #endif // CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ | 97 #endif // CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ |
OLD | NEW |