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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 351363002: Revert of Port HistoryService::GetVisibleVisitCountToHost to CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl/ssl_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 RecordSSLBlockingPageEventStats(SHOW_ALL); 288 RecordSSLBlockingPageEventStats(SHOW_ALL);
289 if (overridable_ && !strict_enforcement_) { 289 if (overridable_ && !strict_enforcement_) {
290 RecordSSLBlockingPageEventStats(SHOW_OVERRIDABLE); 290 RecordSSLBlockingPageEventStats(SHOW_OVERRIDABLE);
291 if (internal_) 291 if (internal_)
292 RecordSSLBlockingPageEventStats(SHOW_INTERNAL_HOSTNAME); 292 RecordSSLBlockingPageEventStats(SHOW_INTERNAL_HOSTNAME);
293 HistoryService* history_service = HistoryServiceFactory::GetForProfile( 293 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
294 profile, Profile::EXPLICIT_ACCESS); 294 profile, Profile::EXPLICIT_ACCESS);
295 if (history_service) { 295 if (history_service) {
296 history_service->GetVisibleVisitCountToHost( 296 history_service->GetVisibleVisitCountToHost(
297 request_url_, 297 request_url_,
298 &request_consumer_,
298 base::Bind(&SSLBlockingPage::OnGotHistoryCount, 299 base::Bind(&SSLBlockingPage::OnGotHistoryCount,
299 base::Unretained(this)), 300 base::Unretained(this)));
300 &request_tracker_);
301 } 301 }
302 } 302 }
303 303
304 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 304 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
305 CaptivePortalService* captive_portal_service = 305 CaptivePortalService* captive_portal_service =
306 CaptivePortalServiceFactory::GetForProfile(profile); 306 CaptivePortalServiceFactory::GetForProfile(profile);
307 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); 307 captive_portal_detection_enabled_ = captive_portal_service ->enabled();
308 captive_portal_service ->DetectCaptivePortal(); 308 captive_portal_service ->DetectCaptivePortal();
309 registrar_.Add(this, 309 registrar_.Add(this,
310 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, 310 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT,
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 }; 715 };
716 int i; 716 int i;
717 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { 717 for (i = 0; i < static_cast<int>(extra_info.size()); i++) {
718 strings->SetString(keys[i], extra_info[i]); 718 strings->SetString(keys[i], extra_info[i]);
719 } 719 }
720 for (; i < 5; i++) { 720 for (; i < 5; i++) {
721 strings->SetString(keys[i], std::string()); 721 strings->SetString(keys[i], std::string());
722 } 722 }
723 } 723 }
724 724
725 void SSLBlockingPage::OnGotHistoryCount(bool success, 725 void SSLBlockingPage::OnGotHistoryCount(HistoryService::Handle handle,
726 bool success,
726 int num_visits, 727 int num_visits,
727 base::Time first_visit) { 728 base::Time first_visit) {
728 num_visits_ = num_visits; 729 num_visits_ = num_visits;
729 } 730 }
730 731
731 void SSLBlockingPage::Observe( 732 void SSLBlockingPage::Observe(
732 int type, 733 int type,
733 const content::NotificationSource& source, 734 const content::NotificationSource& source,
734 const content::NotificationDetails& details) { 735 const content::NotificationDetails& details) {
735 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 736 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
(...skipping 16 matching lines...) Expand all
752 // sure we don't clear the captive portal flag, since the interstitial was 753 // sure we don't clear the captive portal flag, since the interstitial was
753 // potentially caused by the captive portal. 754 // potentially caused by the captive portal.
754 captive_portal_detected_ = captive_portal_detected_ || 755 captive_portal_detected_ = captive_portal_detected_ ||
755 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); 756 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
756 // Also keep track of non-HTTP portals and error cases. 757 // Also keep track of non-HTTP portals and error cases.
757 captive_portal_no_response_ = captive_portal_no_response_ || 758 captive_portal_no_response_ = captive_portal_no_response_ ||
758 (results->result == captive_portal::RESULT_NO_RESPONSE); 759 (results->result == captive_portal::RESULT_NO_RESPONSE);
759 } 760 }
760 #endif 761 #endif
761 } 762 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/browser/ui/website_settings/website_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698