summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications/web_app.h
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 06:13:51 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 06:13:51 +0000
commiteabfdae9101aa33a212fdaf240d8e0af70874e16 (patch)
tree4b27ea5ae52ce96ccfaab87960d067fc1b58968c /chrome/browser/web_applications/web_app.h
parentffb01d3e998a32156790af7c1367d733bb9e75dd (diff)
downloadchromium_src-eabfdae9101aa33a212fdaf240d8e0af70874e16.zip
chromium_src-eabfdae9101aa33a212fdaf240d8e0af70874e16.tar.gz
chromium_src-eabfdae9101aa33a212fdaf240d8e0af70874e16.tar.bz2
Get web app icon via FavIconHelper and auto repair/update
- Expose a DownloadImage method from FavIconHelper to download/decode image for an image url; - Expose FavIconHelper from TabContents; - Update CreateApplicationShortcutView to use the exposed DownloadImage method to get web app icon instead of do it via URLFetcher/PNGCodec; - Check and update web app icon and shortcuts when chrome is lauched as app for OS_WIN; - Code cleanup: - Move a bunch of FavIconHelper methods that are not used externally to private; - Remove an unused cancelable_consumer_ from TabContents; BUG=8539 TEST=Verify issue 8539 is fixed. And create a web page with a non PNG shortcut icon and verify it shows up in create application shortcut dialog. Review URL: http://codereview.chromium.org/482003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications/web_app.h')
-rw-r--r--chrome/browser/web_applications/web_app.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h
index 9bcfe0f..28b1e9c 100644
--- a/chrome/browser/web_applications/web_app.h
+++ b/chrome/browser/web_applications/web_app.h
@@ -8,6 +8,10 @@
#include "base/file_path.h"
#include "base/task.h"
#include "chrome/browser/shell_integration.h"
+#include "webkit/glue/dom_operations.h"
+
+class Profile;
+class TabContents;
namespace web_app {
@@ -33,6 +37,26 @@ void CreateShortcut(
// Returns true if given url is a valid web app url.
bool IsValidUrl(const GURL& url);
+// Returns data dir for web apps for given profile.
+FilePath GetDataDir(Profile* profile);
+
+// Extracts icons info from web app data. Take only square shaped icons and
+// sort them from smallest to largest.
+typedef std::vector<webkit_glue::WebApplicationInfo::IconInfo> IconInfoList;
+void GetIconsInfo(const webkit_glue::WebApplicationInfo& app_info,
+ IconInfoList* icons);
+
+// Extracts shortcut info of given TabContents.
+void GetShortcutInfoForTab(TabContents* tab_contents,
+ ShellIntegration::ShortcutInfo* info);
+
+// Updates web app shortcut of the TabContents. This function checks and
+// updates web app icon and shortcuts if needed. For icon, the check is based
+// on MD5 hash of icon image. For shortcuts, it checks the desktop, start menu
+// and quick launch (as well as pinned shortcut) for shortcut and only
+// updates (recreates) them if they exits.
+void UpdateShortcutForTabContents(TabContents* tab_contents);
+
}; // namespace web_app
#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_