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

Unified Diff: chrome/browser/instant/instant_controller.h

Issue 11413217: Instant API: tell page whether the browser is capturing key strokes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@focus
Patch Set: Rebase and refactor. Created 8 years 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/instant/instant_controller.h
diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h
index 34e78ab1e86101103bbee3e637b643aefa4cef20..765bb103011d1373b03c923ec5893c6415c3cc37 100644
--- a/chrome/browser/instant/instant_controller.h
+++ b/chrome/browser/instant/instant_controller.h
@@ -84,12 +84,12 @@ class InstantController {
// CommitInstant() on the browser, and returns true. Else, returns false.
bool CommitIfCurrent(InstantCommitType type);
- // The omnibox has lost focus. Commit or discard the preview accordingly.
- void OmniboxLostFocus(gfx::NativeView view_gaining_focus);
-
- // The omnibox has gained focus. Preload the default search engine, in
- // anticipation of the user typing a query.
- void OmniboxGotFocus();
+ // Called to indicate that the omnibox focus state changed with the given
+ // |reason|. If |focus_state| is FOCUS_NONE, |view_gaining_focus| is set to
+ // the view gaining focus.
+ void OmniboxFocusChanged(OmniboxFocusState focus_state,
+ OmniboxFocusChangeReason reason,
+ gfx::NativeView view_gaining_focus);
// The search mode in the active tab has changed. Pass the message down to
// the loader which will notify the renderer. Create |instant_tab_| if the
@@ -147,6 +147,9 @@ class InstantController {
FRIEND_TEST_ALL_PREFIXES(InstantTest, NonInstantSearchProvider);
FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantLoaderRefresh);
+ // Helper for OmniboxFocusChanged. Commit or discard the preview.
+ void OmniboxLostFocus(gfx::NativeView view_gaining_focus);
+
// Creates a new loader if necessary, using the instant_url property of the
// |template_url| (for example, if the Instant URL has changed since the last
// time the loader was created). Returns false if the |template_url| doesn't
@@ -237,8 +240,8 @@ class InstantController {
// Used to ensure that the preview page is committable.
bool last_match_was_search_;
- // True if the omnibox is focused, false otherwise.
- bool is_omnibox_focused_;
+ // Omnibox focus state.
+ OmniboxFocusState omnibox_focus_state_;
// The search model mode for the active tab.
chrome::search::Mode search_mode_;

Powered by Google App Engine
This is Rietveld 408576698