| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |