Chromium Code Reviews| Index: chrome/browser/web_applications/web_app_mac.h |
| diff --git a/chrome/browser/web_applications/web_app_mac.h b/chrome/browser/web_applications/web_app_mac.h |
| index 676b20872badfb171ce62fa197b24a3fd63d1a50..615bbcb09f1f5992798d1fd0ea410ef68134b6e7 100644 |
| --- a/chrome/browser/web_applications/web_app_mac.h |
| +++ b/chrome/browser/web_applications/web_app_mac.h |
| @@ -5,6 +5,8 @@ |
| #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
| #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
| +#include <vector> |
| + |
| #include "base/files/file_path.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/strings/string16.h" |
| @@ -38,32 +40,50 @@ class WebAppShortcutCreator { |
| WebAppShortcutCreator( |
| const base::FilePath& user_data_dir, |
| const ShellIntegration::ShortcutInfo& shortcut_info, |
| - const string16& chrome_bundle_id); |
| + const std::string& chrome_bundle_id); |
| virtual ~WebAppShortcutCreator(); |
| - // Returns a path to the destination where the app should be written to. |
| - base::FilePath GetShortcutPath() const; |
| + // Returns the base name for the shortcut. |
| + base::FilePath GetShortcutName() const; |
| + |
| + // Returns a path to the Chrome Apps folder. |
|
tapted
2013/06/18 06:54:59
maybe mention that it's a subfolder of /Applicatio
jackhou1
2013/06/18 08:32:40
Done.
|
| + virtual base::FilePath GetDestinationPath() const; |
| - // Copies the app launcher template into place and fills in all relevant |
| - // information. |
| + // Creates shortcuts for the given shortcut info. |
|
tapted
2013/06/18 06:54:59
I don't think these comments on FooShortcut[s]() a
jackhou1
2013/06/18 08:32:40
Removed.
|
| bool CreateShortcut(); |
|
tapted
2013/06/18 06:54:59
make this plural to be consistent? (also, it's tru
jackhou1
2013/06/18 08:32:40
Done.
|
| + // Deletes shortcuts for the given shortcut info. |
| + void DeleteShortcuts(); |
| + |
| + // Updates shortcuts for the given shortcut info. |
| + bool UpdateShortcuts(); |
| + |
| protected: |
| // Returns a path to the app loader. |
| base::FilePath GetAppLoaderPath() const; |
| - // Returns a path to the destination where the app should be written to. |
| - virtual base::FilePath GetDestinationPath() const; |
| - |
| // Updates the plist inside |app_path| with information about the app. |
| bool UpdatePlist(const base::FilePath& app_path) const; |
| // Updates the icon for the shortcut. |
| bool UpdateIcon(const base::FilePath& app_path) const; |
| + // Returns a path to an app bundle with the given id. Or an empty path if no |
| + // matching bundle was found. |
| + // Here so it can be mocked out for testing. |
|
tapted
2013/06/18 06:54:59
nit: "Here" -> Protected and virtual
jackhou1
2013/06/18 08:32:40
Done.
|
| + virtual base::FilePath GetAppBundleById(const std::string& bundle_id) const; |
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateIcon); |
| + FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateShortcuts); |
| + |
| + // Copies the app loader template into a temporary directory and fills in all |
| + // relevant information. |
| + bool BuildShortcut(const base::FilePath& staging_path) const; |
| + |
| + // Builds a shortcut and copies it into the given destination folders. |
| + bool CreateShortcutsIn(const std::vector<base::FilePath>& folders) const; |
| // Updates the InfoPlist.string inside |app_path| with the display name for |
| // the app. |
| @@ -75,19 +95,16 @@ class WebAppShortcutCreator { |
| base::FilePath user_data_dir_; |
|
tapted
2013/06/18 06:54:59
has the change that moved this landed?. rebase?
jackhou1
2013/06/18 08:32:40
Done.
|
| // Returns the bundle identifier to use for this app bundle. |
| - // |plist| is a dictionary containg a copy of the template plist file to |
| - // be used for creating the app bundle. |
| - NSString* GetBundleIdentifier(NSDictionary* plist) const; |
| + std::string GetBundleIdentifier() const; |
| // Show the bundle we just generated in the Finder. |
| - virtual void RevealGeneratedBundleInFinder( |
| - const base::FilePath& generated_bundle) const; |
| + virtual void RevealAppShimInFinder() const; |
| // Information about the app. |
| ShellIntegration::ShortcutInfo info_; |
| // The CFBundleIdentifier of the Chrome browser bundle. |
| - string16 chrome_bundle_id_; |
| + std::string chrome_bundle_id_; |
| }; |
| } // namespace web_app |