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 17 matching lines...) Expand all Loading... |
28 extension_id == extension_misc::kGoogleSearchAppId || | 28 extension_id == extension_misc::kGoogleSearchAppId || |
29 extension_id == extension_misc::kYoutubeAppId; | 29 extension_id == extension_misc::kYoutubeAppId; |
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* 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 (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 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 for (std::set<std::string>::iterator it = new_default_apps.begin(); | 159 for (std::set<std::string>::iterator it = new_default_apps.begin(); |
160 it != new_default_apps.end(); ++it) { | 160 it != new_default_apps.end(); ++it) { |
161 prefs->Remove(*it, NULL); | 161 prefs->Remove(*it, NULL); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 ExternalProviderImpl::SetPrefs(prefs); | 165 ExternalProviderImpl::SetPrefs(prefs); |
166 } | 166 } |
167 | 167 |
168 } // namespace default_apps | 168 } // namespace default_apps |
OLD | NEW |