OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
11 | 11 |
12 namespace web_app { | 12 namespace web_app { |
13 | 13 |
| 14 // Compute a deterministic name based on the URL. We use this pseudo name |
| 15 // as a key to store window location per application URLs in Browser and |
| 16 // as app id for BrowserWindow, shortcut and jump list. |
| 17 std::wstring GenerateApplicationNameFromURL(const GURL& url); |
| 18 |
14 // Callback after user dismisses CreateShortcutView. "true" indicates | 19 // Callback after user dismisses CreateShortcutView. "true" indicates |
15 // shortcut is created successfully. Otherwise, it is false. | 20 // shortcut is created successfully. Otherwise, it is false. |
16 typedef Callback1<bool>::Type CreateShortcutCallback; | 21 typedef Callback1<bool>::Type CreateShortcutCallback; |
17 | 22 |
18 // Creates a shortcut for web application based on given shortcut data. | 23 // Creates a shortcut for web application based on given shortcut data. |
19 // |root_dir| is used as root directory for persisted data such as icon. | 24 // |root_dir| is used as root directory for persisted data such as icon. |
20 // Directory layout is similar to what Gears has, i.e. an web application's | 25 // Directory layout is similar to what Gears has, i.e. an web application's |
21 // file is stored under "#/host_name/scheme_port", where '#' is the | 26 // file is stored under "#/host_name/scheme_port", where '#' is the |
22 // |root_dir|. | 27 // |root_dir|. |
23 void CreateShortcut( | 28 void CreateShortcut( |
24 const FilePath& data_dir, | 29 const FilePath& data_dir, |
25 const ShellIntegration::ShortcutInfo& shortcut_info, | 30 const ShellIntegration::ShortcutInfo& shortcut_info, |
26 CreateShortcutCallback* callback); | 31 CreateShortcutCallback* callback); |
27 | 32 |
28 }; // namespace web_app | 33 }; // namespace web_app |
29 | 34 |
30 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 35 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |