summaryrefslogtreecommitdiffstats
path: root/chrome/browser/shell_integration.h
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 08:58:15 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 08:58:15 +0000
commit2f5bc32acdb7d8ebe657a4c5a2ce5b98e2c389a4 (patch)
tree395d94e3a49e609769d53bf65f78340c66fe1285 /chrome/browser/shell_integration.h
parentf8e54f8688e8c23d6992884fdbbc177c169c2e3c (diff)
downloadchromium_src-2f5bc32acdb7d8ebe657a4c5a2ce5b98e2c389a4.zip
chromium_src-2f5bc32acdb7d8ebe657a4c5a2ce5b98e2c389a4.tar.gz
chromium_src-2f5bc32acdb7d8ebe657a4c5a2ce5b98e2c389a4.tar.bz2
We want the Applications Menu shortcut paths to be managed by shell_util.cc as
this will allow the uninstaller to clean up shortcuts. BrowserDistribution now provides the name of a distribution-specific Chrome app subfolder, and ShellUtil's utility functions can now create, update, and remove shortcuts therein. This CL introduces some structural changes: -ShellIntegration::ShortcutLocations now uses an enum to specify the Applications Menu location rather than a string. The enum consists of the root of the applications menu, the "Google Chrome" subdirectory and the "Chrome Apps" subdirectory. -ShellUtil::ShortcutLocation has the equivalent locations which are implemented by ShellUtil::GetShortcutPath(). -BrowserDistribution::GetStartMenuShortcutSubfolder() now supports SUBFOLDER_APPS. This CL can be supplementally tested by running setup_unittests. This began a rework of https://codereview.chromium.org/13940006/ for gab@'s post-commit comments. BUG=233434,238895 TEST=setup_unittests.exe, installer_util_unittests.exe Review URL: https://codereview.chromium.org/13864015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration.h')
-rw-r--r--chrome/browser/shell_integration.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index f855984..8d28798 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -106,13 +106,28 @@ class ShellIntegration {
std::string profile_name;
};
+ // This specifies a folder in the system applications menu (e.g the Start Menu
+ // on Windows).
+ //
+ // These represent the applications menu root, the "Google Chrome" folder and
+ // the "Chrome Apps" folder respectively.
+ //
+ // NB: On Linux, these locations may not be used by the window manager (e.g
+ // Unity and Gnome Shell).
+ enum ApplicationsMenuLocation {
+ APP_MENU_LOCATION_NONE,
+ APP_MENU_LOCATION_ROOT,
+ APP_MENU_LOCATION_SUBDIR_CHROME,
+ APP_MENU_LOCATION_SUBDIR_CHROMEAPPS,
+ };
+
// Info about which locations to create app shortcuts in.
struct ShortcutLocations {
ShortcutLocations();
bool on_desktop;
- bool in_applications_menu;
- string16 applications_menu_subdir;
+
+ ApplicationsMenuLocation applications_menu_location;
// For Windows, this refers to quick launch bar prior to Win7. In Win7,
// this means "pin to taskbar". For Mac/Linux, this could be used for
@@ -120,11 +135,13 @@ class ShellIntegration {
// implemented yet.
bool in_quick_launch_bar;
+#if defined(OS_POSIX)
// For Linux, this refers to a shortcut which the system knows about (for
// the purpose of identifying windows and giving them the correct
// title/icon), but which does not show up in menus or search results.
- // Ignored if in_applications_menu == true.
+ // Ignored if applications_menu_location is not APP_MENU_LOCATION_NONE.
bool hidden;
+#endif
};
// Data that needs to be passed between the app launcher stub and Chrome.
@@ -185,6 +202,15 @@ class ShellIntegration {
static base::FilePath GetStartMenuShortcut(const base::FilePath& chrome_exe);
#endif // defined(OS_WIN)
+#if !defined(OS_WIN)
+ // TODO(calamity): replace with
+ // BrowserDistribution::GetStartMenuShortcutSubfolder() once
+ // BrowserDistribution is cross-platform.
+ // Gets the name of the Chrome Apps menu folder in which to place app
+ // shortcuts. This is needed for Mac and Linux.
+ static base::string16 GetAppShortcutsSubdirName();
+#endif
+
// The current default web client application UI state. This is used when
// querying if Chrome is the default browser or the default handler
// application for a url protocol, and communicates the state and result of