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

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

Issue 1233043003: 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], false)) { 40 if (base::EndsWith(locale, unsupported_locales[i],
41 base::CompareCase::INSENSITIVE_ASCII)) {
41 return false; 42 return false;
42 } 43 }
43 } 44 }
44 return true; 45 return true;
45 } 46 }
46 47
47 } // namespace 48 } // namespace
48 49
49 namespace default_apps { 50 namespace default_apps {
50 51
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 for (std::set<std::string>::iterator it = new_default_apps.begin(); 157 for (std::set<std::string>::iterator it = new_default_apps.begin();
157 it != new_default_apps.end(); ++it) { 158 it != new_default_apps.end(); ++it) {
158 prefs->Remove(*it, NULL); 159 prefs->Remove(*it, NULL);
159 } 160 }
160 } 161 }
161 162
162 ExternalProviderImpl::SetPrefs(prefs); 163 ExternalProviderImpl::SetPrefs(prefs);
163 } 164 }
164 165
165 } // namespace default_apps 166 } // namespace default_apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698