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 extensions { |
17 class Extension; | 18 class Extension; |
| 19 } |
18 | 20 |
19 namespace web_app { | 21 namespace web_app { |
20 | 22 |
21 // Gets the user data directory for given web app. The path for the directory is | 23 // Gets the user data directory for given web app. The path for the directory is |
22 // based on |extension_id|. If |extension_id| is empty then |url| is used | 24 // based on |extension_id|. If |extension_id| is empty then |url| is used |
23 // to construct a unique ID. | 25 // to construct a unique ID. |
24 FilePath GetWebAppDataDirectory(const FilePath& profile_path, | 26 FilePath GetWebAppDataDirectory(const FilePath& profile_path, |
25 const std::string& extension_id, | 27 const std::string& extension_id, |
26 const GURL& url); | 28 const GURL& url); |
27 | 29 |
28 // Gets the user data directory to use for |extension| located inside | 30 // Gets the user data directory to use for |extension| located inside |
29 // |profile_path|. | 31 // |profile_path|. |
30 FilePath GetWebAppDataDirectory(const FilePath& profile_path, | 32 FilePath GetWebAppDataDirectory(const FilePath& profile_path, |
31 const Extension& extension); | 33 const extensions::Extension& extension); |
32 | 34 |
33 // Compute a deterministic name based on data in the shortcut_info. | 35 // Compute a deterministic name based on data in the shortcut_info. |
34 std::string GenerateApplicationNameFromInfo( | 36 std::string GenerateApplicationNameFromInfo( |
35 const ShellIntegration::ShortcutInfo& shortcut_info); | 37 const ShellIntegration::ShortcutInfo& shortcut_info); |
36 | 38 |
37 // Compute a deterministic name based on the URL. We use this pseudo name | 39 // Compute a deterministic name based on the URL. We use this pseudo name |
38 // as a key to store window location per application URLs in Browser and | 40 // as a key to store window location per application URLs in Browser and |
39 // as app id for BrowserWindow, shortcut and jump list. | 41 // as app id for BrowserWindow, shortcut and jump list. |
40 std::string GenerateApplicationNameFromURL(const GURL& url); | 42 std::string GenerateApplicationNameFromURL(const GURL& url); |
41 | 43 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 99 |
98 // Sanitizes |name| and returns a version of it that is safe to use as an | 100 // Sanitizes |name| and returns a version of it that is safe to use as an |
99 // on-disk file name . | 101 // on-disk file name . |
100 FilePath GetSanitizedFileName(const string16& name); | 102 FilePath GetSanitizedFileName(const string16& name); |
101 | 103 |
102 } // namespace internals | 104 } // namespace internals |
103 | 105 |
104 } // namespace web_app | 106 } // namespace web_app |
105 | 107 |
106 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 108 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |