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