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

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: Rebase Created 7 years, 8 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/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 a29ab743f614032a55c9aa791ad041700ae7157e..803970a19123af3770b89a5d595286bc185a172f 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -8,6 +8,7 @@
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_switches.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"
@@ -99,17 +100,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,
« no previous file with comments | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698