| 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_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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 base::FilePath profile_path; | 53 base::FilePath profile_path; |
| 54 std::string profile_name; | 54 std::string profile_name; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // This specifies a folder in the system applications menu (e.g the Start Menu | 57 // This specifies a folder in the system applications menu (e.g the Start Menu |
| 58 // on Windows). | 58 // on Windows). |
| 59 // | 59 // |
| 60 // These represent the applications menu root, the "Google Chrome" folder and | 60 // These represent the applications menu root, the "Google Chrome" folder and |
| 61 // the "Chrome Apps" folder respectively. | 61 // the "Chrome Apps" folder respectively. |
| 62 // | 62 // |
| 63 // APP_MENU_LOCATION_HIDDEN specifies a shortcut that is used to register the |
| 64 // app with the OS (in order to give its windows shelf icons, and correct icons |
| 65 // and titles), but the app should not show up in menus or search results. |
| 66 // |
| 63 // NB: On Linux, these locations may not be used by the window manager (e.g | 67 // NB: On Linux, these locations may not be used by the window manager (e.g |
| 64 // Unity and Gnome Shell). | 68 // Unity and Gnome Shell). |
| 65 enum ApplicationsMenuLocation { | 69 enum ApplicationsMenuLocation { |
| 66 APP_MENU_LOCATION_NONE, | 70 APP_MENU_LOCATION_NONE, |
| 67 APP_MENU_LOCATION_ROOT, | 71 APP_MENU_LOCATION_ROOT, |
| 68 APP_MENU_LOCATION_SUBDIR_CHROME, | 72 APP_MENU_LOCATION_SUBDIR_CHROME, |
| 69 APP_MENU_LOCATION_SUBDIR_CHROMEAPPS, | 73 APP_MENU_LOCATION_SUBDIR_CHROMEAPPS, |
| 74 APP_MENU_LOCATION_HIDDEN, |
| 70 }; | 75 }; |
| 71 | 76 |
| 72 // Info about which locations to create app shortcuts in. | 77 // Info about which locations to create app shortcuts in. |
| 73 struct ShortcutLocations { | 78 struct ShortcutLocations { |
| 74 ShortcutLocations(); | 79 ShortcutLocations(); |
| 75 | 80 |
| 76 bool on_desktop; | 81 bool on_desktop; |
| 77 | 82 |
| 78 ApplicationsMenuLocation applications_menu_location; | 83 ApplicationsMenuLocation applications_menu_location; |
| 79 | 84 |
| 80 // For Windows, this refers to quick launch bar prior to Win7. In Win7, | 85 // For Windows, this refers to quick launch bar prior to Win7. In Win7, |
| 81 // this means "pin to taskbar". For Mac/Linux, this could be used for | 86 // this means "pin to taskbar". For Mac/Linux, this could be used for |
| 82 // Mac dock or the gnome/kde application launcher. However, those are not | 87 // Mac dock or the gnome/kde application launcher. However, those are not |
| 83 // implemented yet. | 88 // implemented yet. |
| 84 bool in_quick_launch_bar; | 89 bool in_quick_launch_bar; |
| 85 | |
| 86 #if defined(OS_POSIX) | |
| 87 // For Linux, this refers to a shortcut which the system knows about (for | |
| 88 // the purpose of identifying windows and giving them the correct | |
| 89 // title/icon), but which does not show up in menus or search results. | |
| 90 // Ignored if applications_menu_location is not APP_MENU_LOCATION_NONE. | |
| 91 bool hidden; | |
| 92 #endif | |
| 93 }; | 90 }; |
| 94 | 91 |
| 95 // This encodes the cause of shortcut creation as the correct behavior in each | 92 // This encodes the cause of shortcut creation as the correct behavior in each |
| 96 // case is implementation specific. | 93 // case is implementation specific. |
| 97 enum ShortcutCreationReason { | 94 enum ShortcutCreationReason { |
| 98 SHORTCUT_CREATION_BY_USER, | 95 SHORTCUT_CREATION_BY_USER, |
| 99 SHORTCUT_CREATION_AUTOMATED, | 96 SHORTCUT_CREATION_AUTOMATED, |
| 100 }; | 97 }; |
| 101 | 98 |
| 102 typedef base::Callback<void(const ShortcutInfo&)> ShortcutInfoCallback; | 99 typedef base::Callback<void(const ShortcutInfo&)> ShortcutInfoCallback; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 246 |
| 250 // Sanitizes |name| and returns a version of it that is safe to use as an | 247 // Sanitizes |name| and returns a version of it that is safe to use as an |
| 251 // on-disk file name . | 248 // on-disk file name . |
| 252 base::FilePath GetSanitizedFileName(const base::string16& name); | 249 base::FilePath GetSanitizedFileName(const base::string16& name); |
| 253 | 250 |
| 254 } // namespace internals | 251 } // namespace internals |
| 255 | 252 |
| 256 } // namespace web_app | 253 } // namespace web_app |
| 257 | 254 |
| 258 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 255 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
| OLD | NEW |