OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_BOOKMARK_APP_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BOOKMARK_APP_HELPER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_BOOKMARK_APP_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BOOKMARK_APP_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // This function updates |web_app_info| with the image data of any icon from | 91 // This function updates |web_app_info| with the image data of any icon from |
92 // |bitmap_map| that has a URL and size matching that in |web_app_info|, as | 92 // |bitmap_map| that has a URL and size matching that in |web_app_info|, as |
93 // well as adding any new images from |bitmap_map| that have no URL. | 93 // well as adding any new images from |bitmap_map| that have no URL. |
94 static void UpdateWebAppIconsWithoutChangingLinks( | 94 static void UpdateWebAppIconsWithoutChangingLinks( |
95 std::map<int, BookmarkAppHelper::BitmapAndSource> bitmap_map, | 95 std::map<int, BookmarkAppHelper::BitmapAndSource> bitmap_map, |
96 WebApplicationInfo* web_app_info); | 96 WebApplicationInfo* web_app_info); |
97 | 97 |
98 // Begins the asynchronous bookmark app creation. | 98 // Begins the asynchronous bookmark app creation. |
99 void Create(const CreateBookmarkAppCallback& callback); | 99 void Create(const CreateBookmarkAppCallback& callback); |
100 | 100 |
| 101 // Begins the asynchronous bookmark app creation from an app banner. |
| 102 void CreateFromAppBanner(const CreateBookmarkAppCallback& callback, |
| 103 const content::Manifest& manifest); |
| 104 |
101 private: | 105 private: |
102 friend class TestBookmarkAppHelper; | 106 friend class TestBookmarkAppHelper; |
103 | 107 |
104 // Called by the WebContents when the manifest has been downloaded. If there | 108 // Called by the WebContents when the manifest has been downloaded. If there |
105 // is no manifest, or the WebContents is destroyed before the manifest could | 109 // is no manifest, or the WebContents is destroyed before the manifest could |
106 // be downloaded, this is called with an empty manifest. | 110 // be downloaded, this is called with an empty manifest. |
107 void OnDidGetManifest(const content::Manifest& manifest); | 111 void OnDidGetManifest(const content::Manifest& manifest); |
108 | 112 |
109 // Performs post icon download tasks including installing the bookmark app. | 113 // Performs post icon download tasks including installing the bookmark app. |
110 void OnIconsDownloaded(bool success, | 114 void OnIconsDownloaded(bool success, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 content::BrowserContext* browser_context, | 163 content::BrowserContext* browser_context, |
160 const extensions::Extension* extension, | 164 const extensions::Extension* extension, |
161 const base::Callback<void(const WebApplicationInfo&)> callback); | 165 const base::Callback<void(const WebApplicationInfo&)> callback); |
162 | 166 |
163 // Returns whether the given |url| is a valid bookmark app url. | 167 // Returns whether the given |url| is a valid bookmark app url. |
164 bool IsValidBookmarkAppUrl(const GURL& url); | 168 bool IsValidBookmarkAppUrl(const GURL& url); |
165 | 169 |
166 } // namespace extensions | 170 } // namespace extensions |
167 | 171 |
168 #endif // CHROME_BROWSER_EXTENSIONS_BOOKMARK_APP_HELPER_H_ | 172 #endif // CHROME_BROWSER_EXTENSIONS_BOOKMARK_APP_HELPER_H_ |
OLD | NEW |