| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool is_chrome() const { | 51 bool is_chrome() const { |
| 52 return distribution_->GetType() == BrowserDistribution::CHROME_BROWSER; | 52 return distribution_->GetType() == BrowserDistribution::CHROME_BROWSER; |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool is_chrome_frame() const { | 55 bool is_chrome_frame() const { |
| 56 return distribution_->GetType() == BrowserDistribution::CHROME_FRAME; | 56 return distribution_->GetType() == BrowserDistribution::CHROME_FRAME; |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool is_chrome_app_host() const { |
| 60 return distribution_->GetType() == BrowserDistribution::CHROME_APP_HOST; |
| 61 } |
| 62 |
| 63 bool is_chrome_binaries() const { |
| 64 return distribution_->GetType() == BrowserDistribution::CHROME_BINARIES; |
| 65 } |
| 66 |
| 59 bool HasOption(const std::wstring& option) const { | 67 bool HasOption(const std::wstring& option) const { |
| 60 return options_.find(option) != options_.end(); | 68 return options_.find(option) != options_.end(); |
| 61 } | 69 } |
| 62 | 70 |
| 63 // Returns true if the set of options is mutated by this operation. | 71 // Returns true if the set of options is mutated by this operation. |
| 64 bool SetOption(const std::wstring& option, bool set) { | 72 bool SetOption(const std::wstring& option, bool set) { |
| 65 if (set) | 73 if (set) |
| 66 return options_.insert(option).second; | 74 return options_.insert(option).second; |
| 67 else | 75 else |
| 68 return options_.erase(option) != 0; | 76 return options_.erase(option) != 0; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 scoped_ptr<ProductOperations> operations_; | 128 scoped_ptr<ProductOperations> operations_; |
| 121 std::set<std::wstring> options_; | 129 std::set<std::wstring> options_; |
| 122 | 130 |
| 123 private: | 131 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(Product); | 132 DISALLOW_COPY_AND_ASSIGN(Product); |
| 125 }; | 133 }; |
| 126 | 134 |
| 127 } // namespace installer | 135 } // namespace installer |
| 128 | 136 |
| 129 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ | 137 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ |
| OLD | NEW |