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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_tab_helper.cc

Issue 2260963003: [Offline pages] Enabling notifications for pages saved later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing missed TODO Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/request_coordinator_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/offline_pages/offline_page_tab_helper.h" 5 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // conditions. Also store a cached copy here such that Tab knows that 107 // conditions. Also store a cached copy here such that Tab knows that
108 // the offline page is opened. 108 // the offline page is opened.
109 if (OfflinePageUtils::MightBeOfflineURL(navigated_url)) { 109 if (OfflinePageUtils::MightBeOfflineURL(navigated_url)) {
110 OfflinePageModel* offline_page_model = 110 OfflinePageModel* offline_page_model =
111 OfflinePageModelFactory::GetForBrowserContext( 111 OfflinePageModelFactory::GetForBrowserContext(
112 web_contents()->GetBrowserContext()); 112 web_contents()->GetBrowserContext());
113 if (offline_page_model) { 113 if (offline_page_model) {
114 const OfflinePageItem* offline_page = 114 const OfflinePageItem* offline_page =
115 offline_page_model->MaybeGetPageByOfflineURL(navigated_url); 115 offline_page_model->MaybeGetPageByOfflineURL(navigated_url);
116 if (offline_page && 116 if (offline_page &&
117 offline_page->client_id.name_space == kDownloadNamespace) { 117 (offline_page->client_id.name_space == kDownloadNamespace ||
118 offline_page->client_id.name_space == kAsyncNamespace)) {
118 offline_page_ = base::MakeUnique<OfflinePageItem>(*offline_page); 119 offline_page_ = base::MakeUnique<OfflinePageItem>(*offline_page);
119 return; 120 return;
120 } 121 }
121 } 122 }
122 } 123 }
123 124
124 // Ignore navigations that are forward or back transitions in the nav stack 125 // Ignore navigations that are forward or back transitions in the nav stack
125 // which are not at the head of the stack. 126 // which are not at the head of the stack.
126 // TODO(dimich): Not sure this is needed. Clarify and remove. Bug 624216. 127 // TODO(dimich): Not sure this is needed. Clarify and remove. Bug 624216.
127 const content::NavigationController& controller = 128 const content::NavigationController& controller =
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 entry->GetRedirectChain().back() == to_url; 319 entry->GetRedirectChain().back() == to_url;
319 } 320 }
320 321
321 void OfflinePageTabHelper::ReportRedirectResultUMA(RedirectResult result) { 322 void OfflinePageTabHelper::ReportRedirectResultUMA(RedirectResult result) {
322 UMA_HISTOGRAM_ENUMERATION("OfflinePages.RedirectResult", 323 UMA_HISTOGRAM_ENUMERATION("OfflinePages.RedirectResult",
323 static_cast<int>(result), 324 static_cast<int>(result),
324 static_cast<int>(RedirectResult::REDIRECT_RESULT_MAX)); 325 static_cast<int>(RedirectResult::REDIRECT_RESULT_MAX));
325 } 326 }
326 327
327 } // namespace offline_pages 328 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/request_coordinator_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698