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 #include "chrome/browser/google/google_util.h" | 5 #include "chrome/browser/google/google_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 bool GetBrand(std::string* brand) { | 114 bool GetBrand(std::string* brand) { |
115 if (brand_for_testing) { | 115 if (brand_for_testing) { |
116 brand->assign(brand_for_testing); | 116 brand->assign(brand_for_testing); |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 string16 brand16; | 120 string16 brand16; |
121 bool ret = GoogleUpdateSettings::GetBrand(&brand16); | 121 bool ret = GoogleUpdateSettings::GetBrand(&brand16); |
122 if (ret) | 122 if (ret) |
123 brand->assign(WideToASCII(brand16)); | 123 brand->assign(base::WideToASCII(brand16)); |
124 return ret; | 124 return ret; |
125 } | 125 } |
126 | 126 |
127 bool GetReactivationBrand(std::string* brand) { | 127 bool GetReactivationBrand(std::string* brand) { |
128 string16 brand16; | 128 string16 brand16; |
129 bool ret = GoogleUpdateSettings::GetReactivationBrand(&brand16); | 129 bool ret = GoogleUpdateSettings::GetReactivationBrand(&brand16); |
130 if (ret) | 130 if (ret) |
131 brand->assign(WideToASCII(brand16)); | 131 brand->assign(base::WideToASCII(brand16)); |
132 return ret; | 132 return ret; |
133 } | 133 } |
134 | 134 |
135 #else | 135 #else |
136 | 136 |
137 bool GetBrand(std::string* brand) { | 137 bool GetBrand(std::string* brand) { |
138 if (brand_for_testing) { | 138 if (brand_for_testing) { |
139 brand->assign(brand_for_testing); | 139 brand->assign(brand_for_testing); |
140 return true; | 140 return true; |
141 } | 141 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const char* const kBrands[] = { | 297 const char* const kBrands[] = { |
298 "CHIQ", "CHSG", "HLJY", "NTMO", "OOBA", "OOBB", "OOBC", "OOBD", "OOBE", | 298 "CHIQ", "CHSG", "HLJY", "NTMO", "OOBA", "OOBB", "OOBC", "OOBD", "OOBE", |
299 "OOBF", "OOBG", "OOBH", "OOBI", "OOBJ", "IDCM", | 299 "OOBF", "OOBG", "OOBH", "OOBI", "OOBJ", "IDCM", |
300 }; | 300 }; |
301 const char* const* end = &kBrands[arraysize(kBrands)]; | 301 const char* const* end = &kBrands[arraysize(kBrands)]; |
302 const char* const* found = std::find(&kBrands[0], end, brand); | 302 const char* const* found = std::find(&kBrands[0], end, brand); |
303 return found != end; | 303 return found != end; |
304 } | 304 } |
305 | 305 |
306 } // namespace google_util | 306 } // namespace google_util |
OLD | NEW |