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

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

Issue 13233003: Instant: Use Local NTP in non-incognito whenever possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bec6988a324d7d70c60939c3b1c89cfe33908c7e..bb81748fc747a535a8bda891efe1f2913398aaec 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -483,7 +483,8 @@ bool InstantController::Update(const AutocompleteMatch& match,
}
scoped_ptr<content::WebContents> InstantController::ReleaseNTPContents() {
- if (!extended_enabled_ || use_local_overlay_only_)
+ if (!extended_enabled_ || !browser_->profile() ||
+ browser_->profile()->IsOffTheRecord())
return scoped_ptr<content::WebContents>(NULL);
LOG_INSTANT_DEBUG_EVENT(this, "ReleaseNTPContents");
@@ -491,9 +492,7 @@ scoped_ptr<content::WebContents> InstantController::ReleaseNTPContents() {
if (ShouldSwitchToLocalNTP())
ResetNTP(false, true);
- scoped_ptr<content::WebContents> ntp_contents;
- if (ntp_)
- ntp_contents = ntp_->ReleaseContents();
+ scoped_ptr<content::WebContents> ntp_contents = ntp_->ReleaseContents();
// Override the blacklist on an explicit user action.
ResetNTP(true, false);
@@ -1257,7 +1256,6 @@ void InstantController::OmniboxLostFocus(gfx::NativeView view_gaining_focus) {
}
void InstantController::ResetNTP(bool ignore_blacklist, bool use_local_ntp) {
- ntp_.reset();
std::string instant_url;
if (use_local_ntp ||
!GetInstantURL(browser_->profile(), ignore_blacklist, &instant_url))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698