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

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

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/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_page.h
diff --git a/chrome/browser/ui/search/instant_page.h b/chrome/browser/ui/search/instant_page.h
index 8bb5f2c426db24f8ab2cb9936f98e61d1751bd3f..3bb7270e5093848b7a3704dcb973adbac7b98178 100644
--- a/chrome/browser/ui/search/instant_page.h
+++ b/chrome/browser/ui/search/instant_page.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/string16.h"
#include "chrome/common/instant_types.h"
+#include "chrome/common/omnibox_focus_state.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/page_transition_types.h"
@@ -65,19 +66,10 @@ class InstantPage : public content::WebContentsObserver {
int height,
InstantSizeUnits units) = 0;
- // Called when the page wants the omnibox to be focused.
- virtual void FocusOmnibox(const content::WebContents* contents) = 0;
-
- // Called when the page wants the omnibox to start capturing user key
- // strokes. If this call is processed successfully, the omnibox will not
- // look focused visibly but any user key strokes will go to the omnibox.
- // Currently, this is implemented by focusing the omnibox invisibly.
- virtual void StartCapturingKeyStrokes(
- const content::WebContents* contents) = 0;
-
- // Called when the page wants the omnibox to stop capturing user key
- // strokes.
- virtual void StopCapturingKeyStrokes(content::WebContents* contents) = 0;
+ // Called when the page wants the omnibox to be focused. |state| specifies
+ // the omnibox focus state.
+ virtual void FocusOmnibox(const content::WebContents* contents,
+ OmniboxFocusState state) = 0;
// Called when the page wants to navigate to |url|. Usually used by the
// page to navigate to privileged destinations (e.g. chrome:// URLs) or to
@@ -204,8 +196,6 @@ class InstantPage : public content::WebContentsObserver {
virtual bool ShouldProcessSetSuggestions();
virtual bool ShouldProcessShowInstantOverlay();
virtual bool ShouldProcessFocusOmnibox();
- virtual bool ShouldProcessStartCapturingKeyStrokes();
- virtual bool ShouldProcessStopCapturingKeyStrokes();
virtual bool ShouldProcessNavigateToURL();
private:
@@ -232,9 +222,7 @@ class InstantPage : public content::WebContentsObserver {
void OnShowInstantOverlay(int page_id,
int height,
InstantSizeUnits units);
- void OnFocusOmnibox(int page_id);
- void OnStartCapturingKeyStrokes(int page_id);
- void OnStopCapturingKeyStrokes(int page_id);
+ void OnFocusOmnibox(int page_id, OmniboxFocusState state);
void OnSearchBoxNavigate(int page_id,
const GURL& url,
content::PageTransition transition,
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698