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

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

Issue 10879043: Centralize logic around Instant modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a few more style nits Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | chrome/browser/search_engines/search_terms_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index aac948bd222cd1af46af715770f0aa62250084e7..b954746701cdaf852703817f32c0c4e51a446b63 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -202,9 +202,8 @@ void InstantLoader::WebContentsDelegateImpl::OnSetSuggestions(
loader_->preview_contents_->web_contents());
// TODO(sreeram): Remove this 'if' bandaid once bug 141875 is confirmed fixed.
if (!loader_->preview_contents() ||
- !loader_->preview_contents_->web_contents()) {
+ !loader_->preview_contents_->web_contents())
return;
- }
content::NavigationEntry* entry = loader_->preview_contents_->web_contents()->
GetController().GetActiveEntry();
if (entry && page_id == entry->GetPageID()) {
@@ -220,9 +219,8 @@ void InstantLoader::WebContentsDelegateImpl::OnInstantSupportDetermined(
loader_->preview_contents_->web_contents());
// TODO(sreeram): Remove this 'if' bandaid once bug 141875 is confirmed fixed.
if (!loader_->preview_contents() ||
- !loader_->preview_contents_->web_contents()) {
+ !loader_->preview_contents_->web_contents())
return;
- }
content::NavigationEntry* entry = loader_->preview_contents_->web_contents()->
GetController().GetActiveEntry();
if (entry && page_id == entry->GetPageID())
@@ -315,11 +313,10 @@ TabContents* InstantLoader::ReleasePreviewContents(InstantCommitType type,
const string16& text) {
content::RenderViewHost* rvh =
preview_contents_->web_contents()->GetRenderViewHost();
- if (type == INSTANT_COMMIT_PRESSED_ENTER) {
+ if (type == INSTANT_COMMIT_PRESSED_ENTER)
rvh->Send(new ChromeViewMsg_SearchBoxSubmit(rvh->GetRoutingID(), text));
- } else {
+ else
rvh->Send(new ChromeViewMsg_SearchBoxCancel(rvh->GetRoutingID(), text));
- }
CleanupPreviewContents();
return preview_contents_.release();
}
@@ -334,9 +331,8 @@ void InstantLoader::Observe(int type,
#if defined(OS_MACOSX)
if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) {
if (content::RenderWidgetHostView* rwhv =
- preview_contents_->web_contents()->GetRenderWidgetHostView()) {
+ preview_contents_->web_contents()->GetRenderWidgetHostView())
rwhv->SetTakesFocusOnlyOnMouseDown(true);
- }
return;
}
NOTREACHED();
@@ -364,9 +360,8 @@ void InstantLoader::SetupPreviewContents() {
// SetTakesFocusOnlyOnMouseDown() as a result of the RENDER_VIEW_HOST_CHANGED
// notification.
if (content::RenderWidgetHostView* rwhv =
- new_contents->GetRenderWidgetHostView()) {
+ new_contents->GetRenderWidgetHostView())
rwhv->SetTakesFocusOnlyOnMouseDown(true);
- }
registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
content::Source<content::NavigationController>(
&new_contents->GetController()));
@@ -387,9 +382,8 @@ void InstantLoader::CleanupPreviewContents() {
#if defined(OS_MACOSX)
if (content::RenderWidgetHostView* rwhv =
- old_contents->GetRenderWidgetHostView()) {
+ old_contents->GetRenderWidgetHostView())
rwhv->SetTakesFocusOnlyOnMouseDown(false);
- }
registrar_.Remove(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
content::Source<content::NavigationController>(
&old_contents->GetController()));
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | chrome/browser/search_engines/search_terms_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698