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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "chrome/browser/shell_integration.h" | 14 #include "chrome/browser/shell_integration.h" |
15 #include "chrome/browser/web_applications/web_app.h" | 15 #include "chrome/browser/web_applications/web_app.h" |
| 16 #include "chrome/common/extensions/file_handler_info.h" |
16 | 17 |
17 namespace web_app { | 18 namespace web_app { |
18 | 19 |
19 // Returns the full path of the .app shim that would be created by | 20 // Returns the full path of the .app shim that would be created by |
20 // web_app::CreateShortcuts(). | 21 // web_app::CreateShortcuts(). |
21 base::FilePath GetAppInstallPath( | 22 base::FilePath GetAppInstallPath( |
22 const ShellIntegration::ShortcutInfo& shortcut_info); | 23 const ShellIntegration::ShortcutInfo& shortcut_info); |
23 | 24 |
24 // If necessary, launch the shortcut for an app. | 25 // If necessary, launch the shortcut for an app. |
25 void MaybeLaunchShortcut(const ShellIntegration::ShortcutInfo& shortcut_info); | 26 void MaybeLaunchShortcut(const ShellIntegration::ShortcutInfo& shortcut_info); |
26 | 27 |
27 // Creates a shortcut for a web application. The shortcut is a stub app | 28 // Creates a shortcut for a web application. The shortcut is a stub app |
28 // that simply loads the browser framework and runs the given app. | 29 // that simply loads the browser framework and runs the given app. |
29 class WebAppShortcutCreator { | 30 class WebAppShortcutCreator { |
30 public: | 31 public: |
31 // Creates a new shortcut based on information in |shortcut_info|. | 32 // Creates a new shortcut based on information in |shortcut_info|. |
32 // A copy of the shortcut is placed in |app_data_dir|. | 33 // A copy of the shortcut is placed in |app_data_dir|. |
33 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. | 34 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. |
34 WebAppShortcutCreator( | 35 WebAppShortcutCreator( |
35 const base::FilePath& app_data_dir, | 36 const base::FilePath& app_data_dir, |
36 const ShellIntegration::ShortcutInfo& shortcut_info); | 37 const ShellIntegration::ShortcutInfo& shortcut_info, |
| 38 const extensions::FileHandlersInfo& file_handlers_info); |
37 | 39 |
38 virtual ~WebAppShortcutCreator(); | 40 virtual ~WebAppShortcutCreator(); |
39 | 41 |
40 // Returns the base name for the shortcut. | 42 // Returns the base name for the shortcut. |
41 base::FilePath GetShortcutBasename() const; | 43 base::FilePath GetShortcutBasename() const; |
42 | 44 |
43 // Returns a path to the Chrome Apps folder in the relevant applications | 45 // Returns a path to the Chrome Apps folder in the relevant applications |
44 // folder. E.g. ~/Applications or /Applications. | 46 // folder. E.g. ~/Applications or /Applications. |
45 virtual base::FilePath GetApplicationsDirname() const; | 47 virtual base::FilePath GetApplicationsDirname() const; |
46 | 48 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Updates the icon for the shortcut. | 98 // Updates the icon for the shortcut. |
97 bool UpdateIcon(const base::FilePath& app_path) const; | 99 bool UpdateIcon(const base::FilePath& app_path) const; |
98 | 100 |
99 // Path to the data directory for this app. For example: | 101 // Path to the data directory for this app. For example: |
100 // ~/Library/Application Support/Chromium/Default/Web Applications/_crx_abc/ | 102 // ~/Library/Application Support/Chromium/Default/Web Applications/_crx_abc/ |
101 base::FilePath app_data_dir_; | 103 base::FilePath app_data_dir_; |
102 | 104 |
103 // Information about the app. | 105 // Information about the app. |
104 ShellIntegration::ShortcutInfo info_; | 106 ShellIntegration::ShortcutInfo info_; |
105 | 107 |
| 108 // The app's file handlers. |
| 109 extensions::FileHandlersInfo file_handlers_info_; |
| 110 |
106 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); | 111 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); |
107 }; | 112 }; |
108 | 113 |
109 } // namespace web_app | 114 } // namespace web_app |
110 | 115 |
111 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 116 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
OLD | NEW |