Chromium Code Reviews| 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_MAC_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
| 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 base::FilePath GetApplicationsShortcutPath() const; | 59 base::FilePath GetApplicationsShortcutPath() const; |
| 60 | 60 |
| 61 // The full path to the app bundle under the profile folder. | 61 // The full path to the app bundle under the profile folder. |
| 62 base::FilePath GetInternalShortcutPath() const; | 62 base::FilePath GetInternalShortcutPath() const; |
| 63 | 63 |
| 64 bool CreateShortcuts(ShortcutCreationReason creation_reason, | 64 bool CreateShortcuts(ShortcutCreationReason creation_reason, |
| 65 ShortcutLocations creation_locations); | 65 ShortcutLocations creation_locations); |
| 66 void DeleteShortcuts(); | 66 void DeleteShortcuts(); |
| 67 bool UpdateShortcuts(); | 67 bool UpdateShortcuts(); |
| 68 | 68 |
| 69 // Show the bundle we just generated in the Finder. | |
| 70 virtual void RevealAppShimInFinder() const; | |
| 71 | |
| 72 // Reveals app shim in finder given a profile and app. | |
| 73 // Calls RevealAppShimInFinderForAppOnFileThread and schedules it | |
| 74 // on the FILE thread. | |
| 75 static void RevealAppShimInFinderForApp(Profile* profile, | |
|
jackhou1
2014/12/04 06:37:11
This can just be in web_app:: rather than web_app:
mitchellj
2014/12/04 22:48:40
Done.
| |
| 76 const extensions::Extension* app); | |
| 77 | |
| 78 // Reveals app shim in finder given a profile and app. | |
| 79 // This is executed on the FILE thread. | |
| 80 static void RevealAppShimInFinderForAppOnFileThread( | |
|
jackhou1
2014/12/04 06:37:11
This can just be in the anonymous namespace in web
mitchellj
2014/12/04 22:48:40
Done.
| |
| 81 const ShortcutInfo& shortcut_info, | |
| 82 const base::FilePath& app_path); | |
| 83 | |
| 69 protected: | 84 protected: |
| 70 // Returns a path to an app bundle with the given id. Or an empty path if no | 85 // Returns a path to an app bundle with the given id. Or an empty path if no |
| 71 // matching bundle was found. | 86 // matching bundle was found. |
| 72 // Protected and virtual so it can be mocked out for testing. | 87 // Protected and virtual so it can be mocked out for testing. |
| 73 virtual base::FilePath GetAppBundleById(const std::string& bundle_id) const; | 88 virtual base::FilePath GetAppBundleById(const std::string& bundle_id) const; |
| 74 | 89 |
| 75 // Show the bundle we just generated in the Finder. | |
| 76 virtual void RevealAppShimInFinder() const; | |
| 77 | |
| 78 private: | 90 private: |
| 79 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, DeleteShortcuts); | 91 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, DeleteShortcuts); |
| 80 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateIcon); | 92 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateIcon); |
| 81 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateShortcuts); | 93 FRIEND_TEST_ALL_PREFIXES(WebAppShortcutCreatorTest, UpdateShortcuts); |
| 82 | 94 |
| 83 // Returns the bundle identifier to use for this app bundle. | 95 // Returns the bundle identifier to use for this app bundle. |
| 84 std::string GetBundleIdentifier() const; | 96 std::string GetBundleIdentifier() const; |
| 85 | 97 |
| 86 // Returns the bundle identifier for the internal copy of the bundle. | 98 // Returns the bundle identifier for the internal copy of the bundle. |
| 87 std::string GetInternalBundleIdentifier() const; | 99 std::string GetInternalBundleIdentifier() const; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 116 | 128 |
| 117 // The app's file handlers. | 129 // The app's file handlers. |
| 118 extensions::FileHandlersInfo file_handlers_info_; | 130 extensions::FileHandlersInfo file_handlers_info_; |
| 119 | 131 |
| 120 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); | 132 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreator); |
| 121 }; | 133 }; |
| 122 | 134 |
| 123 } // namespace web_app | 135 } // namespace web_app |
| 124 | 136 |
| 125 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ | 137 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ |
| OLD | NEW |