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

Unified Diff: chrome/browser/android/offline_pages/offline_page_tab_helper.cc

Issue 2002433002: Handle online and offline redirects via interceptor and offline scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/offline_page_tab_helper.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
index b307ad890755b9eca75a64313db1ccd2b9b7aca2..b4d8d8ca5a938afa98d42258f61aadbb19659c9e 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
@@ -83,33 +83,6 @@ void OfflinePageTabHelper::DidStartNavigation(
GURL navigated_url = navigation_handle->GetURL();
if (offline_page_ && navigated_url != offline_page_->GetOfflineURL())
offline_page_ = nullptr;
-
- // Ignore navigations that are forward or back transitions in the nav stack
- // which are not at the head of the stack.
- // TODO(dimich): Not sure this is needed. Clarify and remove. Bug 624216.
- const content::NavigationController& controller =
- web_contents()->GetController();
- if (controller.GetEntryCount() > 0 &&
- controller.GetCurrentEntryIndex() != -1 &&
- controller.GetCurrentEntryIndex() < controller.GetEntryCount() - 1) {
- return;
- }
-
- content::BrowserContext* context = web_contents()->GetBrowserContext();
- if (net::NetworkChangeNotifier::IsOffline()) {
- GetPagesForRedirectToOffline(
- RedirectResult::REDIRECTED_ON_DISCONNECTED_NETWORK, navigated_url);
- return;
- }
-
- OfflinePageModel* offline_page_model =
- OfflinePageModelFactory::GetForBrowserContext(context);
- if (!offline_page_model)
- return;
-
- offline_page_model->GetPageByOfflineURL(
- navigated_url, base::Bind(&OfflinePageTabHelper::RedirectToOnline,
- weak_ptr_factory_.GetWeakPtr(), navigated_url));
}
void OfflinePageTabHelper::DidFinishNavigation(
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_request_redirect_job.cc ('k') | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698