diff options
author | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-01 07:48:53 +0000 |
---|---|---|
committer | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-01 07:48:53 +0000 |
commit | b5ff7ab385273571a809832c52939e98e97455fa (patch) | |
tree | a04b83adbf90c19fb03bf0205955f3d4b8116e40 /chrome/browser/web_applications/web_app.h | |
parent | ea315d056841c6ea0f30f17b2e61ce930c1c5ccd (diff) | |
download | chromium_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/web_applications/web_app.h')
-rw-r--r-- | chrome/browser/web_applications/web_app.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index ced6064..ceacac2 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h @@ -47,8 +47,11 @@ std::string GenerateApplicationNameFromExtensionId(const std::string& id); std::string GetExtensionIdFromApplicationName(const std::string& app_name); // Creates shortcuts for web application based on given shortcut data. -// |shortcut_info| contains information about the shortcuts to create. -void CreateShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info); +// |shortcut_info| contains information about the shortcuts to create, and +// |creation_locations| contains information about where to create them. +void CreateShortcuts( + const ShellIntegration::ShortcutInfo& shortcut_info, + const ShellIntegration::ShortcutLocations& creation_locations); // Delete all the shortcuts that have been created for the given // |shortcut_data| in the profile with |profile_path|. @@ -60,9 +63,11 @@ void UpdateAllShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info); // Creates a shortcut. Must be called on the file thread. This is used to // implement CreateShortcuts() above, and can also be used directly from the -// file thread. |shortcut_info| contains info about the shortcut to create. +// file thread. |shortcut_info| contains info about the shortcut to create, and +// |creation_locations| contains information about where to create them. bool CreateShortcutsOnFileThread( - const ShellIntegration::ShortcutInfo& shortcut_info); + const ShellIntegration::ShortcutInfo& shortcut_info, + const ShellIntegration::ShortcutLocations& creation_locations); // Returns true if given url is a valid web app url. bool IsValidUrl(const GURL& url); @@ -92,10 +97,12 @@ bool CheckAndSaveIcon(const base::FilePath& icon_file, const SkBitmap& image); // shortcuts. Used internally by CreateShortcutsOnFileThread. // |shortcut_data_path| is where to store any resources created for the // shortcut, and is also used as the UserDataDir for platform app shortcuts. -// |shortcut_info| contains info about the shortcut to create. +// |shortcut_info| contains info about the shortcut to create, and +// |creation_locations| contains information about where to create them. bool CreatePlatformShortcuts( const base::FilePath& shortcut_data_path, - const ShellIntegration::ShortcutInfo& shortcut_info); + const ShellIntegration::ShortcutInfo& shortcut_info, + const ShellIntegration::ShortcutLocations& creation_locations); // Delete all the shortcuts we have added for this extension. This is the // platform specific implementation of the DeleteAllShortcuts function, and |