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/command_line.h" | |
tapted
2014/05/05 07:02:01
nit: forward declare?
jackhou1
2014/05/06 04:47:58
Done.
| |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
14 #include "chrome/browser/web_applications/web_app.h" | 15 #include "chrome/browser/web_applications/web_app.h" |
15 #include "chrome/common/extensions/file_handler_info.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 web_app::ShortcutInfo& shortcut_info); | 23 const web_app::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 web_app::ShortcutInfo& shortcut_info); | 26 void MaybeLaunchShortcut(const web_app::ShortcutInfo& shortcut_info); |
26 | 27 |
28 // Rebuild the shortcut and relaunch it. | |
29 bool MaybeRebuildShortcut(const CommandLine& command_line); | |
30 | |
27 // Creates a shortcut for a web application. The shortcut is a stub app | 31 // 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. | 32 // that simply loads the browser framework and runs the given app. |
29 class WebAppShortcutCreator { | 33 class WebAppShortcutCreator { |
30 public: | 34 public: |
31 // Creates a new shortcut based on information in |shortcut_info|. | 35 // Creates a new shortcut based on information in |shortcut_info|. |
32 // A copy of the shortcut is placed in |app_data_dir|. | 36 // A copy of the shortcut is placed in |app_data_dir|. |
33 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. | 37 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle. |
34 WebAppShortcutCreator(const base::FilePath& app_data_dir, | 38 WebAppShortcutCreator(const base::FilePath& app_data_dir, |
35 const web_app::ShortcutInfo& shortcut_info, | 39 const web_app::ShortcutInfo& shortcut_info, |
36 const extensions::FileHandlersInfo& file_handlers_info); | 40 const extensions::FileHandlersInfo& file_handlers_info); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 109 |
106 // The app's file handlers. | 110 // The app's file handlers. |
107 extensions::FileHandlersInfo file_handlers_info_; | 111 extensions::FileHandlersInfo file_handlers_info_; |
108 | 112 |
109 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); | 113 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); |
110 }; | 114 }; |
111 | 115 |
112 } // namespace web_app | 116 } // namespace web_app |
113 | 117 |
114 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 118 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
OLD | NEW |