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

Unified Diff: chrome/renderer/searchbox/searchbox.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
« chrome/browser/ui/search/instant_tab.h ('K') | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index 6fb93fe4a258ad77828774360bee785fc379276b..8a6182346326f9d9a999b213efbcb76e98cb9e7c 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -6,6 +6,7 @@
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
+#include "chrome/common/omnibox_focus_state.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
#include "chrome/renderer/searchbox/searchbox_extension.h"
@@ -97,17 +98,20 @@ void SearchBox::ShowInstantOverlay(int height, InstantSizeUnits units) {
void SearchBox::FocusOmnibox() {
render_view()->Send(new ChromeViewHostMsg_FocusOmnibox(
- render_view()->GetRoutingID(), render_view()->GetPageId()));
+ render_view()->GetRoutingID(), render_view()->GetPageId(),
+ OMNIBOX_FOCUS_VISIBLE));
}
void SearchBox::StartCapturingKeyStrokes() {
- render_view()->Send(new ChromeViewHostMsg_StartCapturingKeyStrokes(
- render_view()->GetRoutingID(), render_view()->GetPageId()));
+ render_view()->Send(new ChromeViewHostMsg_FocusOmnibox(
+ render_view()->GetRoutingID(), render_view()->GetPageId(),
+ OMNIBOX_FOCUS_INVISIBLE));
}
void SearchBox::StopCapturingKeyStrokes() {
- render_view()->Send(new ChromeViewHostMsg_StopCapturingKeyStrokes(
- render_view()->GetRoutingID(), render_view()->GetPageId()));
+ render_view()->Send(new ChromeViewHostMsg_FocusOmnibox(
+ render_view()->GetRoutingID(), render_view()->GetPageId(),
+ OMNIBOX_FOCUS_NONE));
}
void SearchBox::NavigateToURL(const GURL& url,
« chrome/browser/ui/search/instant_tab.h ('K') | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698