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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/callback.h" |
11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/browser/shell_integration.h" | 14 #include "chrome/browser/shell_integration.h" |
14 #include "chrome/common/web_application_info.h" | 15 #include "chrome/common/web_application_info.h" |
15 | 16 |
16 namespace extensions { | 17 namespace extensions { |
17 class Extension; | 18 class Extension; |
18 } | 19 } |
19 | 20 |
20 namespace gfx { | 21 namespace gfx { |
21 class ImageFamily; | 22 class ImageFamily; |
22 } | 23 } |
23 | 24 |
| 25 class Profile; |
| 26 |
24 namespace web_app { | 27 namespace web_app { |
25 | 28 |
26 // Gets the user data directory for given web app. The path for the directory is | 29 // Gets the user data directory for given web app. The path for the directory is |
27 // based on |extension_id|. If |extension_id| is empty then |url| is used | 30 // based on |extension_id|. If |extension_id| is empty then |url| is used |
28 // to construct a unique ID. | 31 // to construct a unique ID. |
29 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path, | 32 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path, |
30 const std::string& extension_id, | 33 const std::string& extension_id, |
31 const GURL& url); | 34 const GURL& url); |
32 | 35 |
33 // Gets the user data directory to use for |extension| located inside | 36 // Gets the user data directory to use for |extension| located inside |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 namespace internals { | 101 namespace internals { |
99 | 102 |
100 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
101 bool CheckAndSaveIcon(const base::FilePath& icon_file, | 104 bool CheckAndSaveIcon(const base::FilePath& icon_file, |
102 const gfx::ImageFamily& image); | 105 const gfx::ImageFamily& image); |
103 | 106 |
104 std::vector<base::FilePath> GetShortcutPaths( | 107 std::vector<base::FilePath> GetShortcutPaths( |
105 const ShellIntegration::ShortcutLocations& creation_locations); | 108 const ShellIntegration::ShortcutLocations& creation_locations); |
106 #endif | 109 #endif |
107 | 110 |
| 111 #if defined(OS_MACOSX) |
| 112 void LaunchShim(Profile* profile, |
| 113 const extensions::Extension* extension, |
| 114 base::Callback<void(bool)> completed); |
| 115 #endif |
| 116 |
108 // Implemented for each platform, does the platform specific parts of creating | 117 // Implemented for each platform, does the platform specific parts of creating |
109 // shortcuts. Used internally by CreateShortcutsOnFileThread. | 118 // shortcuts. Used internally by CreateShortcutsOnFileThread. |
110 // |shortcut_data_path| is where to store any resources created for the | 119 // |shortcut_data_path| is where to store any resources created for the |
111 // shortcut, and is also used as the UserDataDir for platform app shortcuts. | 120 // shortcut, and is also used as the UserDataDir for platform app shortcuts. |
112 // |shortcut_info| contains info about the shortcut to create, and | 121 // |shortcut_info| contains info about the shortcut to create, and |
113 // |creation_locations| contains information about where to create them. | 122 // |creation_locations| contains information about where to create them. |
114 bool CreatePlatformShortcuts( | 123 bool CreatePlatformShortcuts( |
115 const base::FilePath& shortcut_data_path, | 124 const base::FilePath& shortcut_data_path, |
116 const ShellIntegration::ShortcutInfo& shortcut_info, | 125 const ShellIntegration::ShortcutInfo& shortcut_info, |
117 const ShellIntegration::ShortcutLocations& creation_locations); | 126 const ShellIntegration::ShortcutLocations& creation_locations); |
(...skipping 14 matching lines...) Expand all Loading... |
132 | 141 |
133 // Sanitizes |name| and returns a version of it that is safe to use as an | 142 // Sanitizes |name| and returns a version of it that is safe to use as an |
134 // on-disk file name . | 143 // on-disk file name . |
135 base::FilePath GetSanitizedFileName(const string16& name); | 144 base::FilePath GetSanitizedFileName(const string16& name); |
136 | 145 |
137 } // namespace internals | 146 } // namespace internals |
138 | 147 |
139 } // namespace web_app | 148 } // namespace web_app |
140 | 149 |
141 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 150 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |