Index: chrome/browser/instant/instant_loader.cc |
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc |
index 9f2b82b9482a2d70b3f10895a8b4f893d91109a9..14b945f23e87465ae61da81da0f7fbff00f27c85 100644 |
--- a/chrome/browser/instant/instant_loader.cc |
+++ b/chrome/browser/instant/instant_loader.cc |
@@ -98,6 +98,9 @@ class InstantLoader::WebContentsDelegateImpl |
// Message from the renderer determining whether it supports the Instant API. |
void OnInstantSupportDetermined(int page_id, bool result); |
+ // Message from the renderer saying the web searchbox focus state changed. |
+ void OnWebSearchBoxFocusChange(int page_id, bool is_focused); |
+ |
// Message from the renderer requesting the preview be shown. |
void OnShowInstantPreview(int page_id, |
InstantShownReason reason, |
@@ -210,6 +213,8 @@ bool InstantLoader::WebContentsDelegateImpl::OnMessageReceived( |
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetSuggestions, OnSetSuggestions) |
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantSupportDetermined, |
OnInstantSupportDetermined) |
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OnWebSearchBoxFocusChange, |
+ OnWebSearchBoxFocusChange); |
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantPreview, |
OnShowInstantPreview); |
IPC_MESSAGE_UNHANDLED(handled = false) |
@@ -241,6 +246,19 @@ void InstantLoader::WebContentsDelegateImpl::OnInstantSupportDetermined( |
MaybeSetAndNotifyInstantSupportDetermined(result); |
} |
+void InstantLoader::WebContentsDelegateImpl::OnWebSearchBoxFocusChange( |
+ int page_id, |
+ bool is_focused) { |
+ DCHECK(loader_->preview_contents()); |
+ DCHECK(loader_->preview_contents_->web_contents()); |
+ content::NavigationEntry* entry = loader_->preview_contents_->web_contents()-> |
+ GetController().GetActiveEntry(); |
+ if (entry && page_id == entry->GetPageID()) { |
+ MaybeSetAndNotifyInstantSupportDetermined(true); |
+ loader_->controller_->OnWebSearchBoxFocusChange(loader_, is_focused); |
+ } |
+} |
+ |
void InstantLoader::WebContentsDelegateImpl::OnShowInstantPreview( |
int page_id, |
InstantShownReason reason, |