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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 shortcut_info_.is_icon_generated = is_generated; | 264 shortcut_info_.is_icon_generated = is_generated; |
265 is_ready_ = true; | 265 is_ready_ = true; |
266 weak_observer_->OnDataAvailable(shortcut_info_, shortcut_icon_); | 266 weak_observer_->OnDataAvailable(shortcut_info_, shortcut_icon_); |
267 } | 267 } |
268 | 268 |
269 GURL AddToHomescreenDataFetcher::GetShortcutUrl(const GURL& actual_url) { | 269 GURL AddToHomescreenDataFetcher::GetShortcutUrl(const GURL& actual_url) { |
270 GURL original_url = | 270 GURL original_url = |
271 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url); | 271 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url); |
272 | 272 |
273 // If URL points to an offline content, get original URL. | 273 // If URL points to an offline content, get original URL. |
274 GURL online_url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL( | 274 GURL online_url = |
275 web_contents()->GetBrowserContext(), original_url); | 275 offline_pages::OfflinePageUtils::MaybeGetOnlineURLForOfflineURL( |
| 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 |