OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/browser/shell_integration.h" | 13 #include "chrome/browser/shell_integration.h" |
14 #include "webkit/glue/dom_operations.h" | 14 #include "chrome/common/web_apps.h" |
15 | 15 |
16 class FilePath; | 16 class FilePath; |
17 class Profile; | 17 class Profile; |
18 class TabContents; | 18 class TabContents; |
19 | 19 |
20 namespace web_app { | 20 namespace web_app { |
21 | 21 |
22 // Compute a deterministic name based on the URL. We use this pseudo name | 22 // Compute a deterministic name based on the URL. We use this pseudo name |
23 // as a key to store window location per application URLs in Browser and | 23 // as a key to store window location per application URLs in Browser and |
24 // as app id for BrowserWindow, shortcut and jump list. | 24 // as app id for BrowserWindow, shortcut and jump list. |
(...skipping 15 matching lines...) Loading... |
40 | 40 |
41 // Returns true if given url is a valid web app url. | 41 // Returns true if given url is a valid web app url. |
42 bool IsValidUrl(const GURL& url); | 42 bool IsValidUrl(const GURL& url); |
43 | 43 |
44 // Returns data dir for web apps for given profile path. | 44 // Returns data dir for web apps for given profile path. |
45 FilePath GetDataDir(const FilePath& profile_path); | 45 FilePath GetDataDir(const FilePath& profile_path); |
46 | 46 |
47 #if defined(TOOLKIT_VIEWS) | 47 #if defined(TOOLKIT_VIEWS) |
48 // Extracts icons info from web app data. Take only square shaped icons and | 48 // Extracts icons info from web app data. Take only square shaped icons and |
49 // sort them from smallest to largest. | 49 // sort them from smallest to largest. |
50 typedef std::vector<webkit_glue::WebApplicationInfo::IconInfo> IconInfoList; | 50 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; |
51 void GetIconsInfo(const webkit_glue::WebApplicationInfo& app_info, | 51 void GetIconsInfo(const WebApplicationInfo& app_info, |
52 IconInfoList* icons); | 52 IconInfoList* icons); |
53 #endif | 53 #endif |
54 | 54 |
55 // Extracts shortcut info of given TabContents. | 55 // Extracts shortcut info of given TabContents. |
56 void GetShortcutInfoForTab(TabContents* tab_contents, | 56 void GetShortcutInfoForTab(TabContents* tab_contents, |
57 ShellIntegration::ShortcutInfo* info); | 57 ShellIntegration::ShortcutInfo* info); |
58 | 58 |
59 // Updates web app shortcut of the TabContents. This function checks and | 59 // Updates web app shortcut of the TabContents. This function checks and |
60 // updates web app icon and shortcuts if needed. For icon, the check is based | 60 // updates web app icon and shortcuts if needed. For icon, the check is based |
61 // on MD5 hash of icon image. For shortcuts, it checks the desktop, start menu | 61 // on MD5 hash of icon image. For shortcuts, it checks the desktop, start menu |
62 // and quick launch (as well as pinned shortcut) for shortcut and only | 62 // and quick launch (as well as pinned shortcut) for shortcut and only |
63 // updates (recreates) them if they exits. | 63 // updates (recreates) them if they exits. |
64 void UpdateShortcutForTabContents(TabContents* tab_contents); | 64 void UpdateShortcutForTabContents(TabContents* tab_contents); |
65 | 65 |
66 }; // namespace web_app | 66 }; // namespace web_app |
67 | 67 |
68 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 68 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |