OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/google/google_brand.h" | 5 #include "ios/chrome/browser/google/google_brand.h" |
6 | 6 |
7 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 7 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
9 namespace ios { | 13 namespace ios { |
10 namespace google_brand { | 14 namespace google_brand { |
11 | 15 |
12 bool GetBrand(std::string* brand) { | 16 bool GetBrand(std::string* brand) { |
13 if (!ios::GetChromeBrowserProvider()) | 17 if (!ios::GetChromeBrowserProvider()) |
14 return false; | 18 return false; |
15 | 19 |
16 brand->assign(ios::GetChromeBrowserProvider()->GetDistributionBrandCode()); | 20 brand->assign(ios::GetChromeBrowserProvider()->GetDistributionBrandCode()); |
17 return true; | 21 return true; |
18 } | 22 } |
19 | 23 |
20 bool IsOrganic(const std::string& brand) { | 24 bool IsOrganic(const std::string& brand) { |
21 // An empty brand string on iOS is used for organic installation. All other | 25 // An empty brand string on iOS is used for organic installation. All other |
22 // iOS brand string are non-organic. | 26 // iOS brand string are non-organic. |
23 return brand.empty(); | 27 return brand.empty(); |
24 } | 28 } |
25 | 29 |
26 } // namespace google_brand | 30 } // namespace google_brand |
27 } // namespace ios | 31 } // namespace ios |
OLD | NEW |