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

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

Issue 12851023: Refactor omnibox focus API into a single method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. 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
Index: chrome/browser/ui/search/instant_page.cc
diff --git a/chrome/browser/ui/search/instant_page.cc b/chrome/browser/ui/search/instant_page.cc
index 764a5658b1865df35f4eaadc972a3840a68b2cfd..7ba94f698d8879a362946f2c7c2a471cdab1e0e6 100644
--- a/chrome/browser/ui/search/instant_page.cc
+++ b/chrome/browser/ui/search/instant_page.cc
@@ -161,10 +161,6 @@ bool InstantPage::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantOverlay,
OnShowInstantOverlay)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusOmnibox, OnFocusOmnibox)
- IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes,
- OnStartCapturingKeyStrokes);
- IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes,
- OnStopCapturingKeyStrokes);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate,
OnSearchBoxNavigate);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem,
@@ -228,27 +224,10 @@ void InstantPage::OnShowInstantOverlay(int page_id,
}
}
-void InstantPage::OnFocusOmnibox(int page_id) {
+void InstantPage::OnFocusOmnibox(int page_id, OmniboxFocusState state) {
if (contents()->IsActiveEntry(page_id)) {
OnInstantSupportDetermined(page_id, true);
- if (ShouldProcessFocusOmnibox())
- delegate_->FocusOmnibox(contents());
- }
-}
-
-void InstantPage::OnStartCapturingKeyStrokes(int page_id) {
- if (contents()->IsActiveEntry(page_id)) {
- OnInstantSupportDetermined(page_id, true);
- if (ShouldProcessStartCapturingKeyStrokes())
- delegate_->StartCapturingKeyStrokes(contents());
- }
-}
-
-void InstantPage::OnStopCapturingKeyStrokes(int page_id) {
- if (contents()->IsActiveEntry(page_id)) {
- OnInstantSupportDetermined(page_id, true);
- if (ShouldProcessStopCapturingKeyStrokes())
- delegate_->StopCapturingKeyStrokes(contents());
+ delegate_->FocusOmnibox(contents(), state);
sreeram 2013/04/01 16:04:38 Keep the ShouldProcessFocusOmnibox() check, like s
kmadhusu 2013/04/02 02:06:50 Done. Removed the other Should*() functions.
}
}

Powered by Google App Engine
This is Rietveld 408576698