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

Unified Diff: chrome/browser/ui/search/instant_controller.cc

Issue 17303003: InstantExtended: hook up InstantTab in incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dont send other info in incognito. Created 7 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/ui/search/instant_controller.cc
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc
index fe1cc1bd45c2eada466250960fd566e6f61aa770..869f5d27c58fd21a92eea57bac14c40292a599a6 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -1591,7 +1591,8 @@ void InstantController::ResetNTP(const std::string& instant_url) {
// Instant NTP is only used in extended mode so we should always have a
// non-empty URL to use.
DCHECK(!instant_url.empty());
- ntp_.reset(new InstantNTP(this, instant_url));
+ ntp_.reset(new InstantNTP(this, instant_url,
+ browser_->profile()->IsOffTheRecord()));
ntp_->InitContents(profile(), browser_->GetActiveWebContents(),
base::Bind(&InstantController::ReloadStaleNTP,
base::Unretained(this)));
@@ -1632,7 +1633,8 @@ void InstantController::ResetOverlay(const std::string& instant_url) {
if (!active_tab || instant_url.empty()) {
overlay_.reset();
} else {
- overlay_.reset(new InstantOverlay(this, instant_url));
+ overlay_.reset(new InstantOverlay(this, instant_url,
+ browser_->profile()->IsOffTheRecord()));
overlay_->InitContents(browser_->profile(), active_tab);
}
LOG_INSTANT_DEBUG_EVENT(this, base::StringPrintf(
@@ -1662,13 +1664,11 @@ InstantController::ShouldSwitchToLocalOverlay() const {
}
void InstantController::ResetInstantTab() {
- // Do not wire up the InstantTab in Incognito, to prevent it from sending data
- // to the page.
- if (!search_mode_.is_origin_default() &&
- !browser_->profile()->IsOffTheRecord()) {
+ if (!search_mode_.is_origin_default()) {
content::WebContents* active_tab = browser_->GetActiveWebContents();
if (!instant_tab_ || active_tab != instant_tab_->contents()) {
- instant_tab_.reset(new InstantTab(this));
+ instant_tab_.reset(
+ new InstantTab(this, browser_->profile()->IsOffTheRecord()));
instant_tab_->Init(active_tab);
UpdateInfoForInstantTab();
use_tab_for_suggestions_ = true;

Powered by Google App Engine
This is Rietveld 408576698