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/extensions/default_apps.h" | 5 #include "chrome/browser/extensions/default_apps.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 bool IsLocaleSupported() { | 32 bool IsLocaleSupported() { |
33 // Don't bother installing default apps in locales where it is known that | 33 // Don't bother installing default apps in locales where it is known that |
34 // they don't work. | 34 // they don't work. |
35 // TODO(rogerta): Do this check dynamically once the webstore can expose | 35 // TODO(rogerta): Do this check dynamically once the webstore can expose |
36 // an API. See http://crbug.com/101357 | 36 // an API. See http://crbug.com/101357 |
37 const std::string& locale = g_browser_process->GetApplicationLocale(); | 37 const std::string& locale = g_browser_process->GetApplicationLocale(); |
38 static const char* const unsupported_locales[] = {"CN", "TR", "IR"}; | 38 static const char* const unsupported_locales[] = {"CN", "TR", "IR"}; |
39 for (size_t i = 0; i < arraysize(unsupported_locales); ++i) { | 39 for (size_t i = 0; i < arraysize(unsupported_locales); ++i) { |
40 if (EndsWith(locale, unsupported_locales[i], false)) { | 40 if (base::EndsWith(locale, unsupported_locales[i], false)) { |
41 return false; | 41 return false; |
42 } | 42 } |
43 } | 43 } |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 namespace default_apps { | 49 namespace default_apps { |
50 | 50 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 for (std::set<std::string>::iterator it = new_default_apps.begin(); | 156 for (std::set<std::string>::iterator it = new_default_apps.begin(); |
157 it != new_default_apps.end(); ++it) { | 157 it != new_default_apps.end(); ++it) { |
158 prefs->Remove(*it, NULL); | 158 prefs->Remove(*it, NULL); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 ExternalProviderImpl::SetPrefs(prefs); | 162 ExternalProviderImpl::SetPrefs(prefs); |
163 } | 163 } |
164 | 164 |
165 } // namespace default_apps | 165 } // namespace default_apps |
OLD | NEW |