| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h" | 5 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/task/cancelable_task_tracker.h" | 9 #include "base/task/cancelable_task_tracker.h" |
| 10 #include "chrome/browser/android/offline_pages/offline_page_utils.h" | 10 #include "chrome/browser/android/offline_pages/offline_page_utils.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 DCHECK(!weak_observer_); | 163 DCHECK(!weak_observer_); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void AddToHomescreenDataFetcher::FetchSplashScreenImage( | 166 void AddToHomescreenDataFetcher::FetchSplashScreenImage( |
| 167 const std::string& webapp_id) { | 167 const std::string& webapp_id) { |
| 168 ShortcutHelper::FetchSplashScreenImage( | 168 ShortcutHelper::FetchSplashScreenImage( |
| 169 web_contents(), | 169 web_contents(), |
| 170 splash_screen_url_, | 170 splash_screen_url_, |
| 171 ideal_splash_image_size_in_dp_, | 171 ideal_splash_image_size_in_dp_, |
| 172 minimum_splash_image_size_in_dp_, | 172 minimum_splash_image_size_in_dp_, |
| 173 webapp_id); | 173 webapp_id, |
| 174 shortcut_info_.url.spec()); |
| 174 } | 175 } |
| 175 | 176 |
| 176 void AddToHomescreenDataFetcher::FetchFavicon() { | 177 void AddToHomescreenDataFetcher::FetchFavicon() { |
| 177 if (!web_contents() || !weak_observer_) return; | 178 if (!web_contents() || !weak_observer_) return; |
| 178 | 179 |
| 179 Profile* profile = | 180 Profile* profile = |
| 180 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 181 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 181 | 182 |
| 182 // Grab the best, largest icon we can find to represent this bookmark. | 183 // Grab the best, largest icon we can find to represent this bookmark. |
| 183 // TODO(dfalcantara): Try combining with the new BookmarksHandler once its | 184 // TODO(dfalcantara): Try combining with the new BookmarksHandler once its |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url); | 272 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url); |
| 272 | 273 |
| 273 // If URL points to an offline content, get original URL. | 274 // If URL points to an offline content, get original URL. |
| 274 GURL online_url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL( | 275 GURL online_url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL( |
| 275 web_contents()->GetBrowserContext(), original_url); | 276 web_contents()->GetBrowserContext(), original_url); |
| 276 if (online_url.is_valid()) | 277 if (online_url.is_valid()) |
| 277 return online_url; | 278 return online_url; |
| 278 | 279 |
| 279 return original_url; | 280 return original_url; |
| 280 } | 281 } |
| OLD | NEW |