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

Unified Diff: chrome/common/extensions/extension.cc

Issue 12213093: Remove ImageLoadingTracker class (Closed) Base URL: https://git.chromium.org/chromium/src.git@Issue_163929
Patch Set: Fix merge conflict Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index f5e6bbab4c4c91a48e42a7d5af7abd9df99d7527..4e9d2225d42d360b1e7bc33224d0c5ae2e01fee0 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -189,11 +189,6 @@ bool ReadLaunchDimension(const extensions::Manifest* manifest,
return true;
}
-std::string SizeToString(const gfx::Size& max_size) {
- return base::IntToString(max_size.width()) + "x" +
- base::IntToString(max_size.height());
-}
-
bool ContainsManifestForbiddenPermission(const APIPermissionSet& apis,
string16* error) {
CHECK(error);
@@ -871,34 +866,6 @@ GURL Extension::GetFullLaunchURL() const {
url().Resolve(launch_local_path());
}
-void Extension::SetCachedImage(const ExtensionResource& source,
- const SkBitmap& image,
- const gfx::Size& original_size) const {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- const base::FilePath& path = source.relative_path();
- gfx::Size actual_size(image.width(), image.height());
- std::string location;
- if (actual_size != original_size)
- location = SizeToString(actual_size);
- image_cache_[ImageCacheKey(path, location)] = image;
-}
-
-bool Extension::HasCachedImage(const ExtensionResource& source,
- const gfx::Size& max_size) const {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- return GetCachedImageImpl(source, max_size) != NULL;
-}
-
-SkBitmap Extension::GetCachedImage(const ExtensionResource& source,
- const gfx::Size& max_size) const {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- SkBitmap* image = GetCachedImageImpl(source, max_size);
- return image ? *image : SkBitmap();
-}
-
bool Extension::CanExecuteScriptOnPage(const GURL& document_url,
const GURL& top_frame_url,
int tab_id,
@@ -2454,30 +2421,6 @@ bool Extension::LoadContentSecurityPolicy(string16* error) {
return true;
}
-SkBitmap* Extension::GetCachedImageImpl(const ExtensionResource& source,
- const gfx::Size& max_size) const {
- const base::FilePath& path = source.relative_path();
-
- // Look for exact size match.
- ImageCache::iterator i = image_cache_.find(
- ImageCacheKey(path, SizeToString(max_size)));
- if (i != image_cache_.end())
- return &(i->second);
-
- // If we have the original size version cached, return that if it's small
- // enough.
- i = image_cache_.find(ImageCacheKey(path, std::string()));
- if (i != image_cache_.end()) {
- const SkBitmap& image = i->second;
- if (image.width() <= max_size.width() &&
- image.height() <= max_size.height()) {
- return &(i->second);
- }
- }
-
- return NULL;
-}
-
// Helper method that loads a UserScript object from a dictionary in the
// content_script list of the manifest.
bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698