Chromium Code Reviews| 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_UTIL_PRODUCT_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_PRODUCT_H_ |
| 6 #define CHROME_INSTALLER_UTIL_PRODUCT_H_ | 6 #define CHROME_INSTALLER_UTIL_PRODUCT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "chrome/installer/util/browser_distribution.h" | 16 #include "chrome/installer/util/browser_distribution.h" |
|
fdoray
2017/01/10 15:07:37
Can now be forward-declared.
grt (UTC plus 2)
2017/01/11 08:17:54
Done.
| |
| 17 #include "chrome/installer/util/shell_util.h" | 17 #include "chrome/installer/util/shell_util.h" |
| 18 #include "chrome/installer/util/util_constants.h" | 18 #include "chrome/installer/util/util_constants.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class CommandLine; | 21 class CommandLine; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace installer { | 24 namespace installer { |
| 25 | 25 |
| 26 class ChannelInfo; | 26 class ChannelInfo; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 45 | 45 |
| 46 void InitializeFromPreferences(const MasterPreferences& prefs); | 46 void InitializeFromPreferences(const MasterPreferences& prefs); |
| 47 | 47 |
| 48 void InitializeFromUninstallCommand( | 48 void InitializeFromUninstallCommand( |
| 49 const base::CommandLine& uninstall_command); | 49 const base::CommandLine& uninstall_command); |
| 50 | 50 |
| 51 BrowserDistribution* distribution() const { | 51 BrowserDistribution* distribution() const { |
| 52 return distribution_; | 52 return distribution_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool is_type(BrowserDistribution::Type type) const { | |
| 56 return distribution_->GetType() == type; | |
| 57 } | |
| 58 | |
| 59 bool is_chrome() const { | |
| 60 return distribution_->GetType() == BrowserDistribution::CHROME_BROWSER; | |
| 61 } | |
| 62 | |
| 63 bool HasOption(const std::wstring& option) const { | 55 bool HasOption(const std::wstring& option) const { |
| 64 return options_.find(option) != options_.end(); | 56 return options_.find(option) != options_.end(); |
| 65 } | 57 } |
| 66 | 58 |
| 67 // Returns true if the set of options is mutated by this operation. | 59 // Returns true if the set of options is mutated by this operation. |
| 68 bool SetOption(const std::wstring& option, bool set) { | 60 bool SetOption(const std::wstring& option, bool set) { |
| 69 if (set) | 61 if (set) |
| 70 return options_.insert(option).second; | 62 return options_.insert(option).second; |
| 71 else | 63 else |
| 72 return options_.erase(option) != 0; | 64 return options_.erase(option) != 0; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 void LaunchUserExperiment(const base::FilePath& setup_path, | 102 void LaunchUserExperiment(const base::FilePath& setup_path, |
| 111 InstallStatus status, | 103 InstallStatus status, |
| 112 bool system_level) const; | 104 bool system_level) const; |
| 113 | 105 |
| 114 protected: | 106 protected: |
| 115 enum CacheStateFlags { | 107 enum CacheStateFlags { |
| 116 MSI_STATE = 0x01 | 108 MSI_STATE = 0x01 |
| 117 }; | 109 }; |
| 118 | 110 |
| 119 BrowserDistribution* distribution_; | 111 BrowserDistribution* distribution_; |
| 120 std::unique_ptr<ProductOperations> operations_; | 112 std::unique_ptr<ProductOperations> operations_; |
|
fdoray
2017/01/10 15:07:37
const std::unique_ptr<ProductOperations> operation
grt (UTC plus 2)
2017/01/11 08:17:55
Done.
| |
| 121 std::set<std::wstring> options_; | 113 std::set<std::wstring> options_; |
| 122 | 114 |
| 123 private: | 115 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(Product); | 116 DISALLOW_COPY_AND_ASSIGN(Product); |
| 125 }; | 117 }; |
| 126 | 118 |
| 127 } // namespace installer | 119 } // namespace installer |
| 128 | 120 |
| 129 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ | 121 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ |
| OLD | NEW |