OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/instant/instant_client.h" | 5 #include "chrome/browser/instant/instant_client.h" |
6 | 6 |
7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 | 9 |
10 InstantClient::Delegate::~Delegate() { | 10 InstantClient::Delegate::~Delegate() { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 IPC_BEGIN_MESSAGE_MAP(InstantClient, message) | 85 IPC_BEGIN_MESSAGE_MAP(InstantClient, message) |
86 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetSuggestions, SetSuggestions) | 86 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetSuggestions, SetSuggestions) |
87 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantSupportDetermined, | 87 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantSupportDetermined, |
88 InstantSupportDetermined) | 88 InstantSupportDetermined) |
89 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantPreview, | 89 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantPreview, |
90 ShowInstantPreview) | 90 ShowInstantPreview) |
91 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, | 91 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, |
92 StartCapturingKeyStrokes); | 92 StartCapturingKeyStrokes); |
93 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, | 93 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, |
94 StopCapturingKeyStrokes); | 94 StopCapturingKeyStrokes); |
| 95 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate, |
| 96 SearchBoxNavigate); |
95 IPC_MESSAGE_UNHANDLED(handled = false) | 97 IPC_MESSAGE_UNHANDLED(handled = false) |
96 IPC_END_MESSAGE_MAP() | 98 IPC_END_MESSAGE_MAP() |
97 return handled; | 99 return handled; |
98 } | 100 } |
99 | 101 |
100 void InstantClient::RenderViewGone(base::TerminationStatus status) { | 102 void InstantClient::RenderViewGone(base::TerminationStatus status) { |
101 delegate_->RenderViewGone(); | 103 delegate_->RenderViewGone(); |
102 } | 104 } |
103 | 105 |
104 void InstantClient::DidCommitProvisionalLoadForFrame( | 106 void InstantClient::DidCommitProvisionalLoadForFrame( |
(...skipping 29 matching lines...) Expand all Loading... |
134 | 136 |
135 void InstantClient::StartCapturingKeyStrokes(int page_id) { | 137 void InstantClient::StartCapturingKeyStrokes(int page_id) { |
136 if (web_contents()->IsActiveEntry(page_id)) | 138 if (web_contents()->IsActiveEntry(page_id)) |
137 delegate_->StartCapturingKeyStrokes(); | 139 delegate_->StartCapturingKeyStrokes(); |
138 } | 140 } |
139 | 141 |
140 void InstantClient::StopCapturingKeyStrokes(int page_id) { | 142 void InstantClient::StopCapturingKeyStrokes(int page_id) { |
141 if (web_contents()->IsActiveEntry(page_id)) | 143 if (web_contents()->IsActiveEntry(page_id)) |
142 delegate_->StopCapturingKeyStrokes(); | 144 delegate_->StopCapturingKeyStrokes(); |
143 } | 145 } |
| 146 |
| 147 void InstantClient::SearchBoxNavigate(int page_id, const GURL& url) { |
| 148 if (web_contents()->IsActiveEntry(page_id)) |
| 149 delegate_->NavigateToURL(url); |
| 150 } |
OLD | NEW |