summaryrefslogtreecommitdiffstats
path: root/chrome/browser/shell_integration_linux.cc
diff options
context:
space:
mode:
authormgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 07:48:53 +0000
committermgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 07:48:53 +0000
commitb5ff7ab385273571a809832c52939e98e97455fa (patch)
treea04b83adbf90c19fb03bf0205955f3d4b8116e40 /chrome/browser/shell_integration_linux.cc
parentea315d056841c6ea0f30f17b2e61ce930c1c5ccd (diff)
downloadchromium_src-b5ff7ab385273571a809832c52939e98e97455fa.zip
chromium_src-b5ff7ab385273571a809832c52939e98e97455fa.tar.gz
chromium_src-b5ff7ab385273571a809832c52939e98e97455fa.tar.bz2
Split the location flags from ShortcutInfo into a new struct ShortcutLocations.
The majority of code using ShortcutInfo ignores these flags, making it hard to reason about exactly when they will be respected. Now ShortcutLocations is explicitly passed in all the places where it is required (relatively few). Generally, shortcut creation makes use of these flags, whereas shortcut update and deletion does not. In a few places (web_app_ui: ShortcutInfoForExtensionAndProfile, web_app_ui: CheckExistingShortcuts) these booleans were being assigned to, but never read back. Deleted those assignments. BUG=178964 Review URL: https://chromiumcodereview.appspot.com/12382011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_linux.cc')
-rw-r--r--chrome/browser/shell_integration_linux.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index a97a072..e7412ae 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -673,6 +673,7 @@ std::string GetDesktopFileContents(
bool CreateDesktopShortcut(
const ShellIntegration::ShortcutInfo& shortcut_info,
+ const ShellIntegration::ShortcutLocations& creation_locations,
const std::string& shortcut_template) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -682,9 +683,9 @@ bool CreateDesktopShortcut(
shortcut_info.profile_path, shortcut_info.extension_id);
// For extensions we do not want duplicate shortcuts. So, delete any that
// already exist and replace them.
- if (shortcut_info.create_on_desktop)
+ if (creation_locations.on_desktop)
DeleteShortcutOnDesktop(shortcut_filename);
- if (shortcut_info.create_in_applications_menu)
+ if (creation_locations.in_applications_menu)
DeleteShortcutInApplicationsMenu(shortcut_filename);
} else {
shortcut_filename = GetWebShortcutFilename(shortcut_info.url);
@@ -708,10 +709,10 @@ bool CreateDesktopShortcut(
bool success = true;
- if (shortcut_info.create_on_desktop)
+ if (creation_locations.on_desktop)
success = CreateShortcutOnDesktop(shortcut_filename, contents);
- if (shortcut_info.create_in_applications_menu)
+ if (creation_locations.in_applications_menu)
success = CreateShortcutInApplicationsMenu(shortcut_filename, contents) &&
success;