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

Unified Diff: chrome/renderer/searchbox/searchbox.h

Issue 14646034: Add onfocuschange to the Extended Search API, with associated isFocused attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using KeyCaptureChange IPC for notification of focus change, and checking if it really changed in t… Created 7 years, 7 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/renderer/searchbox/searchbox.h
diff --git a/chrome/renderer/searchbox/searchbox.h b/chrome/renderer/searchbox/searchbox.h
index 441994ba3d30850bdc8d54c39ed85914caa3d88b..2f80b00793fadc5acee7c91b8f4264386db72d43 100644
--- a/chrome/renderer/searchbox/searchbox.h
+++ b/chrome/renderer/searchbox/searchbox.h
@@ -11,6 +11,7 @@
#include "base/string16.h"
#include "chrome/common/instant_restricted_id_cache.h"
#include "chrome/common/instant_types.h"
+#include "chrome/common/omnibox_focus_state.h"
#include "chrome/common/search_types.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/renderer/render_view_observer.h"
@@ -65,11 +66,16 @@ class SearchBox : public content::RenderViewObserver,
bool query_is_restricted() const { return query_is_restricted_; }
size_t selection_start() const { return selection_start_; }
size_t selection_end() const { return selection_end_; }
- bool is_key_capture_enabled() const { return is_key_capture_enabled_; }
bool display_instant_results() const { return display_instant_results_; }
const string16& omnibox_font() const { return omnibox_font_; }
size_t omnibox_font_size() const { return omnibox_font_size_; }
+ // Returns whether the omnibox is focused.
+ bool is_focused() const;
+
+ // Returns whether key capturing is enabled.
+ bool is_key_capture_enabled() const;
+
// In extended Instant, returns the start-edge margin of the location bar in
// screen pixels.
int GetStartMargin() const;
@@ -134,7 +140,8 @@ class SearchBox : public content::RenderViewObserver,
bool verbatim,
size_t selection_start,
size_t selection_end);
- void OnKeyCaptureChange(bool is_key_capture_enabled);
+ void OnKeyCaptureChange(OmniboxFocusState new_focus_state,
+ OmniboxFocusChangeReason reason);
void OnSetDisplayInstantResults(bool display_instant_results);
void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
void OnThemeAreaHeightChanged(int height);
@@ -159,7 +166,7 @@ class SearchBox : public content::RenderViewObserver,
size_t selection_end_;
int start_margin_;
gfx::Rect popup_bounds_;
- bool is_key_capture_enabled_;
+ OmniboxFocusState omnibox_focus_state_;
ThemeBackgroundInfo theme_info_;
bool display_instant_results_;
string16 omnibox_font_;

Powered by Google App Engine
This is Rietveld 408576698