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

Unified Diff: chrome/browser/extensions/crx_installer.h

Issue 11034027: cros: Preload external extension icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.h
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h
index e9541dec8204defc135dbc6dfef30595eab22ef2..50859709e6b68811e4d2774e25245d21e71e8023 100644
--- a/chrome/browser/extensions/crx_installer.h
+++ b/chrome/browser/extensions/crx_installer.h
@@ -5,7 +5,10 @@
#ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_
#define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_
+#include <map>
+#include <set>
#include <string>
+#include <vector>
#include "base/compiler_specific.h"
#include "base/file_path.h"
@@ -170,6 +173,8 @@ class CrxInstaller
error_on_unsupported_requirements_ = val;
}
+ void set_preload_sizes(const std::set<int>& sizes) { preload_sizes_ = sizes; }
+
bool did_handle_successfully() const { return did_handle_successfully_; }
Profile* profile() { return profile_; }
@@ -225,6 +230,12 @@ class CrxInstaller
void ReportSuccessFromUIThread();
void NotifyCrxInstallComplete(const Extension* extension);
+ // Runs on File thread. Preload icons if necessary.
+ void PreloadIcons();
+
+ // Runs on UI thread. Update extension icon cache with pre-loaded icons.
+ void CachePreloadedIcons();
+
// The file we're installing.
FilePath source_file_;
@@ -359,6 +370,12 @@ class CrxInstaller
bool has_requirement_errors_;
+ // Sizes of the icons that need to be pre-loaded.
+ std::set<int> preload_sizes_;
+
+ // Maps requested preload icon size to loaded icons.
+ std::map<int, SkBitmap> preload_map_;
+
DISALLOW_COPY_AND_ASSIGN(CrxInstaller);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698