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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 7689003: Don't do Instant previews of chrome://crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Centralize debug URLs Created 9 years, 4 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
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 63d2ca4223258048097a05f86feace497573e9b1..bfedf40c19a8acd9931be9c5c3aa3d9f0de7c187 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -32,11 +32,23 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h"
+namespace {
+
// Number of ms to delay between loading urls.
-static const int kUpdateDelayMS = 200;
+const int kUpdateDelayMS = 200;
// Amount of time we delay before showing pages that have a non-200 status.
-static const int kShowDelayMS = 800;
+const int kShowDelayMS = 800;
+
+bool IsBlacklistedUrl(const GURL& url) {
+ for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) {
+ if (url == GURL(chrome::kChromeDebugURLs[i]))
+ return true;
+ }
+ return false;
+}
+
+}
// static
InstantController::HostBlacklist* InstantController::host_blacklist_ = NULL;
@@ -714,7 +726,11 @@ InstantController::PreviewCondition InstantController::GetPreviewConditionFor(
// Was the host blacklisted?
if (host_blacklist_ && host_blacklist_->count(match.destination_url.host()))
- return PREVIEW_CONDITION_BLACKLISTED;
+ return PREVIEW_CONDITION_BLACKLISTED_HOST;
+
+ // Was the URL blacklisted?
+ if (IsBlacklistedUrl(match.destination_url))
+ return PREVIEW_CONDITION_BLACKLISTED_URL;
const CommandLine* cl = CommandLine::ForCurrentProcess();
if ((cl->HasSwitch(switches::kRestrictInstantToSearch) ||
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698