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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 303483006: Fix a data URL generation code in DeveloperPrivateAPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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/app_window.h" 9 #include "apps/app_window.h"
10 #include "apps/app_window_registry.h" 10 #include "apps/app_window_registry.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 ExtensionUpdater* GetExtensionUpdater(Profile* profile) { 95 ExtensionUpdater* GetExtensionUpdater(Profile* profile) {
96 return profile->GetExtensionService()->updater(); 96 return profile->GetExtensionService()->updater();
97 } 97 }
98 98
99 GURL GetImageURLFromData(const std::string& contents) { 99 GURL GetImageURLFromData(const std::string& contents) {
100 std::string contents_base64; 100 std::string contents_base64;
101 base::Base64Encode(contents, &contents_base64); 101 base::Base64Encode(contents, &contents_base64);
102 102
103 // TODO(dvh): make use of content::kDataScheme. Filed as crbug/297301. 103 // TODO(dvh): make use of content::kDataScheme. Filed as crbug/297301.
104 const char kDataURLPrefix[] = "data:image;base64,"; 104 const char kDataURLPrefix[] = "data:;base64,";
105 return GURL(kDataURLPrefix + contents_base64); 105 return GURL(kDataURLPrefix + contents_base64);
106 } 106 }
107 107
108 GURL GetDefaultImageURL(developer_private::ItemType type) { 108 GURL GetDefaultImageURL(developer_private::ItemType type) {
109 int icon_resource_id; 109 int icon_resource_id;
110 switch (type) { 110 switch (type) {
111 case developer::ITEM_TYPE_LEGACY_PACKAGED_APP: 111 case developer::ITEM_TYPE_LEGACY_PACKAGED_APP:
112 case developer::ITEM_TYPE_HOSTED_APP: 112 case developer::ITEM_TYPE_HOSTED_APP:
113 case developer::ITEM_TYPE_PACKAGED_APP: 113 case developer::ITEM_TYPE_PACKAGED_APP:
114 icon_resource_id = IDR_APP_DEFAULT_ICON; 114 icon_resource_id = IDR_APP_DEFAULT_ICON;
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 } 1359 }
1360 1360
1361 error_ui_util::HandleOpenDevTools(dict); 1361 error_ui_util::HandleOpenDevTools(dict);
1362 1362
1363 return true; 1363 return true;
1364 } 1364 }
1365 1365
1366 } // namespace api 1366 } // namespace api
1367 1367
1368 } // namespace extensions 1368 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698