Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc

Issue 2040573002: [Offlining] Updates the tab helper to use the async OfflinePageModel API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix TODOs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698