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 // This file contains the specification of setup main functions. | 5 // This file contains the specification of setup main functions. |
6 | 6 |
7 #ifndef CHROME_INSTALLER_SETUP_INSTALL_H_ | 7 #ifndef CHROME_INSTALLER_SETUP_INSTALL_H_ |
8 #define CHROME_INSTALLER_SETUP_INSTALL_H_ | 8 #define CHROME_INSTALLER_SETUP_INSTALL_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/version.h" | 13 #include "base/version.h" |
14 #include "chrome/installer/util/installation_state.h" | 14 #include "chrome/installer/util/installation_state.h" |
15 #include "chrome/installer/util/installer_state.h" | 15 #include "chrome/installer/util/installer_state.h" |
16 #include "chrome/installer/util/master_preferences.h" | 16 #include "chrome/installer/util/master_preferences.h" |
17 #include "chrome/installer/util/product.h" | 17 #include "chrome/installer/util/product.h" |
18 #include "chrome/installer/util/util_constants.h" | 18 #include "chrome/installer/util/util_constants.h" |
19 | 19 |
| 20 namespace base { |
20 class FilePath; | 21 class FilePath; |
| 22 } |
21 | 23 |
22 namespace installer { | 24 namespace installer { |
23 | 25 |
24 class InstallationState; | 26 class InstallationState; |
25 class InstallerState; | 27 class InstallerState; |
26 class MasterPreferences; | 28 class MasterPreferences; |
27 | 29 |
28 enum InstallShortcutOperation { | 30 enum InstallShortcutOperation { |
29 // Create all shortcuts (potentially skipping those explicitly stated not to | 31 // Create all shortcuts (potentially skipping those explicitly stated not to |
30 // be installed in the InstallShortcutPreferences). | 32 // be installed in the InstallShortcutPreferences). |
(...skipping 17 matching lines...) Expand all Loading... |
48 }; | 50 }; |
49 | 51 |
50 // Escape |att_value| as per the XML AttValue production | 52 // Escape |att_value| as per the XML AttValue production |
51 // (http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue) for a value in | 53 // (http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue) for a value in |
52 // single quotes. | 54 // single quotes. |
53 void EscapeXmlAttributeValueInSingleQuotes(string16* att_value); | 55 void EscapeXmlAttributeValueInSingleQuotes(string16* att_value); |
54 | 56 |
55 // Creates VisualElementsManifest.xml beside chrome.exe in |src_path| if | 57 // Creates VisualElementsManifest.xml beside chrome.exe in |src_path| if |
56 // |src_path|\VisualElements exists. | 58 // |src_path|\VisualElements exists. |
57 // Returns true unless the manifest is supposed to be created, but fails to be. | 59 // Returns true unless the manifest is supposed to be created, but fails to be. |
58 bool CreateVisualElementsManifest(const FilePath& src_path, | 60 bool CreateVisualElementsManifest(const base::FilePath& src_path, |
59 const Version& version); | 61 const Version& version); |
60 | 62 |
61 // Overwrites shortcuts (desktop, quick launch, and start menu) if they are | 63 // Overwrites shortcuts (desktop, quick launch, and start menu) if they are |
62 // present on the system. | 64 // present on the system. |
63 // |prefs| can affect the behavior of this method through | 65 // |prefs| can affect the behavior of this method through |
64 // kDoNotCreateDesktopShortcut, kDoNotCreateQuickLaunchShortcut, and | 66 // kDoNotCreateDesktopShortcut, kDoNotCreateQuickLaunchShortcut, and |
65 // kAltShortcutText. | 67 // kAltShortcutText. |
66 // |install_level| specifies whether to install per-user shortcuts or shortcuts | 68 // |install_level| specifies whether to install per-user shortcuts or shortcuts |
67 // for all users on the system (this should only be used to update legacy | 69 // for all users on the system (this should only be used to update legacy |
68 // system-level installs). | 70 // system-level installs). |
69 // If |install_operation| is a creation command, appropriate shortcuts will be | 71 // If |install_operation| is a creation command, appropriate shortcuts will be |
70 // created even if they don't exist. | 72 // created even if they don't exist. |
71 // If creating the Start menu shortcut is successful, it is also pinned to the | 73 // If creating the Start menu shortcut is successful, it is also pinned to the |
72 // taskbar. | 74 // taskbar. |
73 void CreateOrUpdateShortcuts( | 75 void CreateOrUpdateShortcuts( |
74 const FilePath& target, | 76 const base::FilePath& target, |
75 const Product& product, | 77 const Product& product, |
76 const MasterPreferences& prefs, | 78 const MasterPreferences& prefs, |
77 InstallShortcutLevel install_level, | 79 InstallShortcutLevel install_level, |
78 InstallShortcutOperation install_operation); | 80 InstallShortcutOperation install_operation); |
79 | 81 |
80 // Registers Chrome on this machine. | 82 // Registers Chrome on this machine. |
81 // If |make_chrome_default|, also attempts to make Chrome default (potentially | 83 // If |make_chrome_default|, also attempts to make Chrome default (potentially |
82 // popping a UAC if the user is not an admin and HKLM registrations are required | 84 // popping a UAC if the user is not an admin and HKLM registrations are required |
83 // to register Chrome's capabilities on this version of Windows (i.e. | 85 // to register Chrome's capabilities on this version of Windows (i.e. |
84 // pre-Win8)). | 86 // pre-Win8)). |
(...skipping 15 matching lines...) Expand all Loading... |
100 // prefs: master preferences. See chrome/installer/util/master_preferences.h. | 102 // prefs: master preferences. See chrome/installer/util/master_preferences.h. |
101 // new_version: new Chrome version that needs to be installed | 103 // new_version: new Chrome version that needs to be installed |
102 // package: Represents the target installation folder and all distributions | 104 // package: Represents the target installation folder and all distributions |
103 // to be installed in that folder. | 105 // to be installed in that folder. |
104 // | 106 // |
105 // Note: since caller unpacks Chrome to install_temp_path\source, the caller | 107 // Note: since caller unpacks Chrome to install_temp_path\source, the caller |
106 // is responsible for cleaning up install_temp_path. | 108 // is responsible for cleaning up install_temp_path. |
107 InstallStatus InstallOrUpdateProduct( | 109 InstallStatus InstallOrUpdateProduct( |
108 const InstallationState& original_state, | 110 const InstallationState& original_state, |
109 const InstallerState& installer_state, | 111 const InstallerState& installer_state, |
110 const FilePath& setup_path, | 112 const base::FilePath& setup_path, |
111 const FilePath& archive_path, | 113 const base::FilePath& archive_path, |
112 const FilePath& install_temp_path, | 114 const base::FilePath& install_temp_path, |
113 const FilePath& src_path, | 115 const base::FilePath& src_path, |
114 const FilePath& prefs_path, | 116 const base::FilePath& prefs_path, |
115 const installer::MasterPreferences& prefs, | 117 const installer::MasterPreferences& prefs, |
116 const Version& new_version); | 118 const Version& new_version); |
117 | 119 |
118 // Performs installation-related tasks following an OS upgrade. | 120 // Performs installation-related tasks following an OS upgrade. |
119 // |chrome| The installed product (must be a browser). | 121 // |chrome| The installed product (must be a browser). |
120 void HandleOsUpgradeForBrowser(const InstallerState& installer_state, | 122 void HandleOsUpgradeForBrowser(const InstallerState& installer_state, |
121 const Product& chrome); | 123 const Product& chrome); |
122 | 124 |
123 // Performs per-user installation-related tasks on Active Setup (ran on first | 125 // Performs per-user installation-related tasks on Active Setup (ran on first |
124 // login for each user post system-level Chrome install). | 126 // login for each user post system-level Chrome install). |
125 // |installation_root|: The root of this install (i.e. the directory in which | 127 // |installation_root|: The root of this install (i.e. the directory in which |
126 // chrome.exe is installed). | 128 // chrome.exe is installed). |
127 // Shortcut creation is skipped if the First Run beacon is present (unless | 129 // Shortcut creation is skipped if the First Run beacon is present (unless |
128 // |force| is set to true). | 130 // |force| is set to true). |
129 // |chrome| The installed product (must be a browser). | 131 // |chrome| The installed product (must be a browser). |
130 void HandleActiveSetupForBrowser(const FilePath& installation_root, | 132 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, |
131 const Product& chrome, | 133 const Product& chrome, |
132 bool force); | 134 bool force); |
133 | 135 |
134 // Launches app_host.exe to install content from web store (non-blocking). | 136 // Launches app_host.exe to install content from web store (non-blocking). |
135 // Returns true on successful execution (although successful installation | 137 // Returns true on successful execution (although successful installation |
136 // is not guaranteed). | 138 // is not guaranteed). |
137 bool InstallFromWebstore(const std::string& app_code); | 139 bool InstallFromWebstore(const std::string& app_code); |
138 | 140 |
139 } // namespace installer | 141 } // namespace installer |
140 | 142 |
141 #endif // CHROME_INSTALLER_SETUP_INSTALL_H_ | 143 #endif // CHROME_INSTALLER_SETUP_INSTALL_H_ |
OLD | NEW |