| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const ShellIntegration::ShortcutInfo& shortcut_info); | 23 const ShellIntegration::ShortcutInfo& shortcut_info); |
| 24 | 24 |
| 25 // Compute a deterministic name based on the URL. We use this pseudo name | 25 // Compute a deterministic name based on the URL. We use this pseudo name |
| 26 // as a key to store window location per application URLs in Browser and | 26 // as a key to store window location per application URLs in Browser and |
| 27 // as app id for BrowserWindow, shortcut and jump list. | 27 // as app id for BrowserWindow, shortcut and jump list. |
| 28 std::string GenerateApplicationNameFromURL(const GURL& url); | 28 std::string GenerateApplicationNameFromURL(const GURL& url); |
| 29 | 29 |
| 30 // Compute a deterministic name based on an extension/apps's id. | 30 // Compute a deterministic name based on an extension/apps's id. |
| 31 std::string GenerateApplicationNameFromExtensionId(const std::string& id); | 31 std::string GenerateApplicationNameFromExtensionId(const std::string& id); |
| 32 | 32 |
| 33 // Extracts the extension id from the app name. |
| 34 std::string GetExtensionIdFromApplicationName(const std::string& app_name); |
| 35 |
| 33 // Callback after user dismisses CreateShortcutView. "true" indicates | 36 // Callback after user dismisses CreateShortcutView. "true" indicates |
| 34 // shortcut is created successfully. Otherwise, it is false. | 37 // shortcut is created successfully. Otherwise, it is false. |
| 35 typedef Callback1<bool>::Type CreateShortcutCallback; | 38 typedef Callback1<bool>::Type CreateShortcutCallback; |
| 36 | 39 |
| 37 // Creates a shortcut for web application based on given shortcut data. | 40 // Creates a shortcut for web application based on given shortcut data. |
| 38 // |profile_path| is used as root directory for persisted data such as icon. | 41 // |profile_path| is used as root directory for persisted data such as icon. |
| 39 // Directory layout is similar to what Gears has, i.e. an web application's | 42 // Directory layout is similar to what Gears has, i.e. an web application's |
| 40 // file is stored under "#/host_name/scheme_port", where '#' is the | 43 // file is stored under "#/host_name/scheme_port", where '#' is the |
| 41 // |root_dir|. A crx based app uses a directory named _crx_<app id>. | 44 // |root_dir|. A crx based app uses a directory named _crx_<app id>. |
| 42 void CreateShortcut( | 45 void CreateShortcut( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); | 76 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); |
| 74 #endif | 77 #endif |
| 75 | 78 |
| 76 FilePath GetWebAppDataDirectory(const FilePath& root_dir, | 79 FilePath GetWebAppDataDirectory(const FilePath& root_dir, |
| 77 const ShellIntegration::ShortcutInfo& info); | 80 const ShellIntegration::ShortcutInfo& info); |
| 78 } // namespace internals | 81 } // namespace internals |
| 79 | 82 |
| 80 } // namespace web_app | 83 } // namespace web_app |
| 81 | 84 |
| 82 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 85 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
| OLD | NEW |