| 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/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
| 9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
| 10 #include "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 const base::FilePath::CharType kUnpackedAppsFolder[] | 82 const base::FilePath::CharType kUnpackedAppsFolder[] |
| 83 = FILE_PATH_LITERAL("apps_target"); | 83 = FILE_PATH_LITERAL("apps_target"); |
| 84 | 84 |
| 85 ExtensionUpdater* GetExtensionUpdater(Profile* profile) { | 85 ExtensionUpdater* GetExtensionUpdater(Profile* profile) { |
| 86 return profile->GetExtensionService()->updater(); | 86 return profile->GetExtensionService()->updater(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 GURL GetImageURLFromData(std::string contents) { | 89 GURL GetImageURLFromData(std::string contents) { |
| 90 std::string contents_base64; | 90 std::string contents_base64; |
| 91 base::Base64Encode(contents, &contents_base64); | 91 if (!base::Base64Encode(contents, &contents_base64)) |
| 92 return GURL(); |
| 92 | 93 |
| 93 // TODO(dvh): make use of chrome::kDataScheme. Filed as crbug/297301. | 94 // TODO(dvh): make use of chrome::kDataScheme. Filed as crbug/297301. |
| 94 const char kDataURLPrefix[] = "data:image;base64,"; | 95 const char kDataURLPrefix[] = "data:image;base64,"; |
| 95 return GURL(kDataURLPrefix + contents_base64); | 96 return GURL(kDataURLPrefix + contents_base64); |
| 96 } | 97 } |
| 97 | 98 |
| 98 GURL GetDefaultImageURL(developer_private::ItemType type) { | 99 GURL GetDefaultImageURL(developer_private::ItemType type) { |
| 99 int icon_resource_id; | 100 int icon_resource_id; |
| 100 switch (type) { | 101 switch (type) { |
| 101 case developer::ITEM_TYPE_LEGACY_PACKAGED_APP: | 102 case developer::ITEM_TYPE_LEGACY_PACKAGED_APP: |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 return true; | 1341 return true; |
| 1341 } | 1342 } |
| 1342 | 1343 |
| 1343 DeveloperPrivateIsProfileManagedFunction:: | 1344 DeveloperPrivateIsProfileManagedFunction:: |
| 1344 ~DeveloperPrivateIsProfileManagedFunction() { | 1345 ~DeveloperPrivateIsProfileManagedFunction() { |
| 1345 } | 1346 } |
| 1346 | 1347 |
| 1347 } // namespace api | 1348 } // namespace api |
| 1348 | 1349 |
| 1349 } // namespace extensions | 1350 } // namespace extensions |
| OLD | NEW |