OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/browser/shell_integration.h" | 14 #include "chrome/browser/shell_integration.h" |
15 #include "chrome/common/web_apps.h" | 15 #include "chrome/common/web_apps.h" |
16 | 16 |
17 namespace web_app { | 17 namespace web_app { |
18 | 18 |
| 19 // Returns data directory for given web app url. |
| 20 FilePath GetWebAppDataDirectory(const FilePath& profile_path, |
| 21 const std::string& extension_id, |
| 22 const GURL& url); |
| 23 |
19 // Compute a deterministic name based on data in the shortcut_info. | 24 // Compute a deterministic name based on data in the shortcut_info. |
20 std::string GenerateApplicationNameFromInfo( | 25 std::string GenerateApplicationNameFromInfo( |
21 const ShellIntegration::ShortcutInfo& shortcut_info); | 26 const ShellIntegration::ShortcutInfo& shortcut_info); |
22 | 27 |
23 // Compute a deterministic name based on the URL. We use this pseudo name | 28 // Compute a deterministic name based on the URL. We use this pseudo name |
24 // as a key to store window location per application URLs in Browser and | 29 // as a key to store window location per application URLs in Browser and |
25 // as app id for BrowserWindow, shortcut and jump list. | 30 // as app id for BrowserWindow, shortcut and jump list. |
26 std::string GenerateApplicationNameFromURL(const GURL& url); | 31 std::string GenerateApplicationNameFromURL(const GURL& url); |
27 | 32 |
28 // Compute a deterministic name based on an extension/apps's id. | 33 // Compute a deterministic name based on an extension/apps's id. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // them as a separate application. | 65 // them as a separate application. |
61 std::string GetWMClassFromAppName(std::string app_name); | 66 std::string GetWMClassFromAppName(std::string app_name); |
62 #endif | 67 #endif |
63 | 68 |
64 namespace internals { | 69 namespace internals { |
65 | 70 |
66 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
67 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); | 72 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); |
68 #endif | 73 #endif |
69 | 74 |
70 FilePath GetWebAppDataDirectory(const FilePath& root_dir, | |
71 const ShellIntegration::ShortcutInfo& info); | |
72 | |
73 // Does the actual job of creating a shortcut (see CreateShortcut() above). | 75 // Does the actual job of creating a shortcut (see CreateShortcut() above). |
74 // This must be called on the file thread. | 76 // This must be called on the file thread. |
75 void CreateShortcutTask(const FilePath& web_app_path, | 77 void CreateShortcutTask(const FilePath& web_app_path, |
76 const FilePath& profile_path, | 78 const FilePath& profile_path, |
77 const ShellIntegration::ShortcutInfo& shortcut_info); | 79 const ShellIntegration::ShortcutInfo& shortcut_info); |
78 | 80 |
79 // Sanitizes |name| and returns a version of it that is safe to use as an | 81 // Sanitizes |name| and returns a version of it that is safe to use as an |
80 // on-disk file name . | 82 // on-disk file name . |
81 FilePath GetSanitizedFileName(const string16& name); | 83 FilePath GetSanitizedFileName(const string16& name); |
82 | 84 |
83 } // namespace internals | 85 } // namespace internals |
84 | 86 |
85 } // namespace web_app | 87 } // namespace web_app |
86 | 88 |
87 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 89 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |