Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/extensions/default_apps.cc

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 (base::EndsWith(locale, unsupported_locales[i], 40 if (base::EndsWith(locale, unsupported_locales[i], false)) {
41 base::CompareCase::INSENSITIVE_ASCII)) {
42 return false; 41 return false;
43 } 42 }
44 } 43 }
45 return true; 44 return true;
46 } 45 }
47 46
48 } // namespace 47 } // namespace
49 48
50 namespace default_apps { 49 namespace default_apps {
51 50
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 for (std::set<std::string>::iterator it = new_default_apps.begin(); 156 for (std::set<std::string>::iterator it = new_default_apps.begin();
158 it != new_default_apps.end(); ++it) { 157 it != new_default_apps.end(); ++it) {
159 prefs->Remove(*it, NULL); 158 prefs->Remove(*it, NULL);
160 } 159 }
161 } 160 }
162 161
163 ExternalProviderImpl::SetPrefs(prefs); 162 ExternalProviderImpl::SetPrefs(prefs);
164 } 163 }
165 164
166 } // namespace default_apps 165 } // namespace default_apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698