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_MAC_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/file_path.h" | |
9 #include "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
10 | 11 |
11 namespace web_app { | 12 namespace web_app { |
12 | 13 |
13 // Creates a shortcut for a web application. The shortcut is a stub app | 14 // Creates a shortcut for a web application. The shortcut is a stub app |
14 // that simply loads the browser framework and runs the given app. | 15 // that simply loads the browser framework and runs the given app. |
15 class WebAppShortcutCreator { | 16 class WebAppShortcutCreator { |
16 public: | 17 public: |
17 // Creates a new shortcut based on information in |shortcut_info|. | 18 // Creates a new shortcut based on information in |shortcut_info|. |
19 // The shortcut store its data directory in |web_app_path|. | |
jeremy
2012/02/12 09:40:28
nit: store -> stores
| |
18 explicit WebAppShortcutCreator( | 20 explicit WebAppShortcutCreator( |
21 const FilePath& web_app_path, | |
19 const ShellIntegration::ShortcutInfo& shortcut_info); | 22 const ShellIntegration::ShortcutInfo& shortcut_info); |
20 virtual ~WebAppShortcutCreator(); | 23 virtual ~WebAppShortcutCreator(); |
21 | 24 |
22 // Creates a shortcut. | 25 // Creates a shortcut. |
23 bool CreateShortcut(); | 26 bool CreateShortcut(); |
24 | 27 |
25 protected: | 28 protected: |
26 // Returns a path to the app loader. | 29 // Returns a path to the app loader. |
27 FilePath GetAppLoaderPath() const; | 30 FilePath GetAppLoaderPath() const; |
28 | 31 |
29 // Returns a path to the destination where the app should be written to. | 32 // Returns a path to the destination where the app should be written to. |
30 virtual FilePath GetDestinationPath(const FilePath& app_file_name) const; | 33 virtual FilePath GetDestinationPath(const FilePath& app_file_name) const; |
31 | 34 |
32 // Updates the plist inside |app_path| with information about the app. | 35 // Updates the plist inside |app_path| with information about the app. |
33 bool UpdatePlist(const FilePath& app_path) const; | 36 bool UpdatePlist(const FilePath& app_path) const; |
34 | 37 |
35 // Updates the icon for the shortcut. | 38 // Updates the icon for the shortcut. |
36 bool UpdateIcon(const FilePath& app_path) const; | 39 bool UpdateIcon(const FilePath& app_path) const; |
37 | 40 |
38 private: | 41 private: |
42 // Path to the app's data directory. For example: | |
43 // ~/Library/Application Support/Chromium/Default/Web Applications/_crx_abc/ | |
44 FilePath web_app_path_; | |
45 | |
39 // Information about the app. | 46 // Information about the app. |
40 ShellIntegration::ShortcutInfo info_; | 47 ShellIntegration::ShortcutInfo info_; |
41 }; | 48 }; |
42 | 49 |
43 } // namespace web_app | 50 } // namespace web_app |
44 | 51 |
45 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 52 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
OLD | NEW |