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 27 matching lines...) Expand all Loading... |
47 | 49 |
48 // Returns true if --chrome-frame is on the command line. | 50 // Returns true if --chrome-frame is on the command line. |
49 bool has_chrome_frame() const { return has_chrome_frame_; } | 51 bool has_chrome_frame() const { return has_chrome_frame_; } |
50 | 52 |
51 // Returns true if --multi-install is on the command line. | 53 // Returns true if --multi-install is on the command line. |
52 bool is_multi_install() const { return is_multi_install_; } | 54 bool is_multi_install() const { return is_multi_install_; } |
53 | 55 |
54 // Returns true if --system-level is on the command line. | 56 // Returns true if --system-level is on the command line. |
55 bool is_system_level() const { return is_system_level_; } | 57 bool is_system_level() const { return is_system_level_; } |
56 | 58 |
| 59 // Retuns true if --chrome-sxs is on the command line. |
| 60 bool is_side_by_side() const { return is_side_by_side_; } |
| 61 |
57 // Returns the previous version contained in the image's resource. | 62 // Returns the previous version contained in the image's resource. |
58 const wchar_t* previous_version() const { return previous_version_; } | 63 const wchar_t* previous_version() const { return previous_version_; } |
59 | 64 |
60 protected: | 65 protected: |
61 void Clear(); | 66 void Clear(); |
62 bool ParseCommandLine(const wchar_t* command_line); | 67 bool ParseCommandLine(const wchar_t* command_line); |
63 void ReadResources(HMODULE module); | 68 void ReadResources(HMODULE module); |
64 | 69 |
65 wchar_t** args_; | 70 wchar_t** args_; |
66 const wchar_t* chrome_app_guid_; | 71 const wchar_t* chrome_app_guid_; |
67 const wchar_t* command_line_; | 72 const wchar_t* command_line_; |
68 int argument_count_; | 73 int argument_count_; |
69 Operation operation_; | 74 Operation operation_; |
70 bool has_chrome_; | 75 bool has_chrome_; |
71 bool has_chrome_frame_; | 76 bool has_chrome_frame_; |
72 bool is_multi_install_; | 77 bool is_multi_install_; |
73 bool is_system_level_; | 78 bool is_system_level_; |
| 79 bool is_side_by_side_; |
74 const wchar_t* previous_version_; | 80 const wchar_t* previous_version_; |
75 | 81 |
| 82 protected: |
| 83 typedef StackString<128> ValueString; |
| 84 |
| 85 // Virtual for testing. |
| 86 virtual bool ReadClientStateRegistryValue( |
| 87 const HKEY root_key, const wchar_t* app_guid, |
| 88 LONG* retval, ValueString& value); |
| 89 |
76 private: | 90 private: |
77 Configuration(const Configuration&); | 91 Configuration(const Configuration&); |
78 Configuration& operator=(const Configuration&); | 92 Configuration& operator=(const Configuration&); |
| 93 |
| 94 void SetChromeAppGuid(); |
79 }; | 95 }; |
80 | 96 |
81 } // namespace mini_installer | 97 } // namespace mini_installer |
82 | 98 |
83 #endif // CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ | 99 #endif // CHROME_INSTALLER_MINI_INSTALLER_CONFIGURATION_H_ |
OLD | NEW |