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

Unified Diff: ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm

Issue 2578973002: Reload offline version on load failure (Closed)
Patch Set: clean Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm
diff --git a/ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm b/ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm
deleted file mode 100644
index 3b34fc68c34e064fbbe4d9d5e5213a08bb917338..0000000000000000000000000000000000000000
--- a/ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ios/chrome/browser/reading_list/reading_list_entry_loading_util.h"
-
-#include "components/reading_list/ios/reading_list_entry.h"
-#include "components/reading_list/ios/reading_list_model.h"
-#include "ios/chrome/browser/reading_list/offline_url_utils.h"
-#include "ios/chrome/browser/reading_list/reading_list_web_state_observer.h"
-#import "ios/web/public/navigation_manager.h"
-#import "ios/web/public/web_state/web_state.h"
-#include "net/base/network_change_notifier.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace reading_list {
-
-void LoadReadingListEntry(ReadingListEntry const& entry,
- ReadingListModel* model,
- web::WebState* web_state) {
- // TODO(crbug.com/625617): Evaluate whether NetworkChangeNotifier
- // correctly detects when users are offline.
- bool open_distilled_entry =
- net::NetworkChangeNotifier::IsOffline() &&
- entry.DistilledState() == ReadingListEntry::PROCESSED;
- if (open_distilled_entry) {
- return LoadReadingListDistilled(entry, model, web_state);
- }
-
- DCHECK(entry.URL().is_valid());
- web::NavigationManager::WebLoadParams params(entry.URL());
- params.transition_type = ui::PageTransition::PAGE_TRANSITION_AUTO_BOOKMARK;
- web_state->GetNavigationManager()->LoadURLWithParams(params);
- ReadingListWebStateObserver* web_state_observer =
- ReadingListWebStateObserver::FromWebState(web_state, model);
- web_state_observer->StartCheckingProgress(entry.URL());
-}
-
-void LoadReadingListDistilled(ReadingListEntry const& entry,
- ReadingListModel* model,
- web::WebState* web_state) {
- DCHECK(entry.DistilledState() == ReadingListEntry::PROCESSED);
- GURL url =
- reading_list::DistilledURLForPath(entry.DistilledPath(), entry.URL());
- DCHECK(url.is_valid());
- web::NavigationManager::WebLoadParams params(url);
- params.transition_type = ui::PageTransition::PAGE_TRANSITION_AUTO_BOOKMARK;
- web_state->GetNavigationManager()->LoadURLWithParams(params);
- model->SetReadStatus(entry.URL(), true);
-}
-
-} // namespace reading_list

Powered by Google App Engine
This is Rietveld 408576698