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

Side by Side Diff: chrome/browser/ui/app_list/search/webstore/webstore_provider.cc

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/app_list/search/webstore/webstore_provider.h" 5 #include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 19 matching lines...) Expand all
30 const char kKeyIconUrl[] = "icon_url"; 30 const char kKeyIconUrl[] = "icon_url";
31 const char kKeyItemType[] = "item_type"; 31 const char kKeyItemType[] = "item_type";
32 32
33 const char kPlatformAppType[] = "platform_app"; 33 const char kPlatformAppType[] = "platform_app";
34 const char kHostedAppType[] = "hosted_app"; 34 const char kHostedAppType[] = "hosted_app";
35 const char kLegacyPackagedAppType[] = "legacy_packaged_app"; 35 const char kLegacyPackagedAppType[] = "legacy_packaged_app";
36 36
37 // Converts the item type string from the web store to an 37 // Converts the item type string from the web store to an
38 // extensions::Manifest::Type. 38 // extensions::Manifest::Type.
39 extensions::Manifest::Type ParseItemType(const std::string& item_type_str) { 39 extensions::Manifest::Type ParseItemType(const std::string& item_type_str) {
40 if (LowerCaseEqualsASCII(item_type_str, kPlatformAppType)) 40 if (base::LowerCaseEqualsASCII(item_type_str, kPlatformAppType))
41 return extensions::Manifest::TYPE_PLATFORM_APP; 41 return extensions::Manifest::TYPE_PLATFORM_APP;
42 42
43 if (LowerCaseEqualsASCII(item_type_str, kLegacyPackagedAppType)) 43 if (base::LowerCaseEqualsASCII(item_type_str, kLegacyPackagedAppType))
44 return extensions::Manifest::TYPE_LEGACY_PACKAGED_APP; 44 return extensions::Manifest::TYPE_LEGACY_PACKAGED_APP;
45 45
46 if (LowerCaseEqualsASCII(item_type_str, kHostedAppType)) 46 if (base::LowerCaseEqualsASCII(item_type_str, kHostedAppType))
47 return extensions::Manifest::TYPE_HOSTED_APP; 47 return extensions::Manifest::TYPE_HOSTED_APP;
48 48
49 return extensions::Manifest::TYPE_UNKNOWN; 49 return extensions::Manifest::TYPE_UNKNOWN;
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 WebstoreProvider::WebstoreProvider(Profile* profile, 54 WebstoreProvider::WebstoreProvider(Profile* profile,
55 AppListControllerDelegate* controller) 55 AppListControllerDelegate* controller)
56 : WebserviceSearchProvider(profile), 56 : WebserviceSearchProvider(profile),
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 std::string item_type_string; 165 std::string item_type_string;
166 dict.GetString(kKeyItemType, &item_type_string); 166 dict.GetString(kKeyItemType, &item_type_string);
167 extensions::Manifest::Type item_type = ParseItemType(item_type_string); 167 extensions::Manifest::Type item_type = ParseItemType(item_type_string);
168 168
169 result.reset(new WebstoreResult( 169 result.reset(new WebstoreResult(
170 profile_, app_id, localized_name, icon_url, item_type, controller_)); 170 profile_, app_id, localized_name, icon_url, item_type, controller_));
171 return result.Pass(); 171 return result.Pass();
172 } 172 }
173 173
174 } // namespace app_list 174 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698