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/web_applications/web_app.h" | 14 #include "chrome/browser/web_applications/web_app.h" |
15 #include "extensions/common/manifest_handlers/file_handler_info.h" | 15 #include "extensions/common/manifest_handlers/file_handler_info.h" |
16 | 16 |
| 17 namespace base { |
| 18 class CommandLine; |
| 19 } |
| 20 |
17 // Whether to enable update and launch of app shims in tests. (Normally shims | 21 // Whether to enable update and launch of app shims in tests. (Normally shims |
18 // are never created or launched in tests). Note that update only creates | 22 // are never created or launched in tests). Note that update only creates |
19 // internal shim bundles, i.e. it does not create new shims in ~/Applications. | 23 // internal shim bundles, i.e. it does not create new shims in ~/Applications. |
20 extern bool g_app_shims_allow_update_and_launch_in_tests; | 24 extern bool g_app_shims_allow_update_and_launch_in_tests; |
21 | 25 |
22 namespace web_app { | 26 namespace web_app { |
23 | 27 |
24 // Returns the full path of the .app shim that would be created by | 28 // Returns the full path of the .app shim that would be created by |
25 // CreateShortcuts(). | 29 // CreateShortcuts(). |
26 base::FilePath GetAppInstallPath(const ShortcutInfo& shortcut_info); | 30 base::FilePath GetAppInstallPath(const ShortcutInfo& shortcut_info); |
27 | 31 |
28 // If necessary, launch the shortcut for an app. | 32 // If necessary, launch the shortcut for an app. |
29 void MaybeLaunchShortcut(const ShortcutInfo& shortcut_info); | 33 void MaybeLaunchShortcut(const ShortcutInfo& shortcut_info); |
30 | 34 |
| 35 // Rebuild the shortcut and relaunch it. |
| 36 bool MaybeRebuildShortcut(const base::CommandLine& command_line); |
| 37 |
31 // Creates a shortcut for a web application. The shortcut is a stub app | 38 // Creates a shortcut for a web application. The shortcut is a stub app |
32 // that simply loads the browser framework and runs the given app. | 39 // that simply loads the browser framework and runs the given app. |
33 class WebAppShortcutCreator { | 40 class WebAppShortcutCreator { |
34 public: | 41 public: |
35 // Creates a new shortcut based on information in |shortcut_info|. | 42 // Creates a new shortcut based on information in |shortcut_info|. |
36 // A copy of the shortcut is placed in |app_data_dir|. | 43 // A copy of the shortcut is placed in |app_data_dir|. |
37 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. | 44 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. |
38 WebAppShortcutCreator(const base::FilePath& app_data_dir, | 45 WebAppShortcutCreator(const base::FilePath& app_data_dir, |
39 const ShortcutInfo& shortcut_info, | 46 const ShortcutInfo& shortcut_info, |
40 const extensions::FileHandlersInfo& file_handlers_info); | 47 const extensions::FileHandlersInfo& file_handlers_info); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 116 |
110 // The app's file handlers. | 117 // The app's file handlers. |
111 extensions::FileHandlersInfo file_handlers_info_; | 118 extensions::FileHandlersInfo file_handlers_info_; |
112 | 119 |
113 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); | 120 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); |
114 }; | 121 }; |
115 | 122 |
116 } // namespace web_app | 123 } // namespace web_app |
117 | 124 |
118 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 125 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
OLD | NEW |