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> |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // them as a separate application. | 68 // them as a separate application. |
64 std::string GetWMClassFromAppName(std::string app_name); | 69 std::string GetWMClassFromAppName(std::string app_name); |
65 #endif | 70 #endif |
66 | 71 |
67 namespace internals { | 72 namespace internals { |
68 | 73 |
69 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
70 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); | 75 bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image); |
71 #endif | 76 #endif |
72 | 77 |
73 FilePath GetWebAppDataDirectory(const FilePath& root_dir, | |
74 const ShellIntegration::ShortcutInfo& info); | |
75 | |
76 void CreateShortcutTask(const FilePath& web_app_path, | 78 void CreateShortcutTask(const FilePath& web_app_path, |
77 const FilePath& profile_path, | 79 const FilePath& profile_path, |
78 const ShellIntegration::ShortcutInfo& shortcut_info); | 80 const ShellIntegration::ShortcutInfo& shortcut_info); |
79 | 81 |
80 // Returns sanitized name that could be used as a file name | 82 // Returns sanitized name that could be used as a 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 |