| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Creates a shortcut for web application based on given shortcut data. | 34 // Creates a shortcut for web application based on given shortcut data. |
| 35 // |profile_path| is used as root directory for persisted data such as icon. | 35 // |profile_path| is used as root directory for persisted data such as icon. |
| 36 // Directory layout is similar to what Gears has, i.e. an web application's | 36 // Directory layout is similar to what Gears has, i.e. an web application's |
| 37 // file is stored under "#/host_name/scheme_port", where '#' is the | 37 // file is stored under "#/host_name/scheme_port", where '#' is the |
| 38 // |root_dir|. A crx based app uses a directory named _crx_<app id>. | 38 // |root_dir|. A crx based app uses a directory named _crx_<app id>. |
| 39 void CreateShortcut( | 39 void CreateShortcut( |
| 40 const FilePath& profile_path, | 40 const FilePath& profile_path, |
| 41 const ShellIntegration::ShortcutInfo& shortcut_info); | 41 const ShellIntegration::ShortcutInfo& shortcut_info); |
| 42 | 42 |
| 43 // Allow tests to disable shortcut creation. | |
| 44 void SetDisableShortcutCreationForTests(bool disable); | |
| 45 | |
| 46 // Returns true if given url is a valid web app url. | 43 // Returns true if given url is a valid web app url. |
| 47 bool IsValidUrl(const GURL& url); | 44 bool IsValidUrl(const GURL& url); |
| 48 | 45 |
| 49 // Returns data dir for web apps for given profile path. | 46 // Returns data dir for web apps for given profile path. |
| 50 FilePath GetDataDir(const FilePath& profile_path); | 47 FilePath GetDataDir(const FilePath& profile_path); |
| 51 | 48 |
| 52 #if defined(TOOLKIT_VIEWS) | 49 #if defined(TOOLKIT_VIEWS) |
| 53 // Extracts icons info from web app data. Take only square shaped icons and | 50 // Extracts icons info from web app data. Take only square shaped icons and |
| 54 // sort them from smallest to largest. | 51 // sort them from smallest to largest. |
| 55 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; | 52 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 72 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); | 69 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); |
| 73 #endif | 70 #endif |
| 74 | 71 |
| 75 FilePath GetWebAppDataDirectory(const FilePath& root_dir, | 72 FilePath GetWebAppDataDirectory(const FilePath& root_dir, |
| 76 const ShellIntegration::ShortcutInfo& info); | 73 const ShellIntegration::ShortcutInfo& info); |
| 77 } // namespace internals | 74 } // namespace internals |
| 78 | 75 |
| 79 } // namespace web_app | 76 } // namespace web_app |
| 80 | 77 |
| 81 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 78 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
| OLD | NEW |