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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.h

Issue 11369137: Implement {Start,Stop}CapturingKeyStrokes for Instant. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Restore caret visibility differently. 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/ui/omnibox/omnibox_edit_model.h
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.h b/chrome/browser/ui/omnibox/omnibox_edit_model.h
index 6caf62f542932a94b4d3cbe564454c88cc6574c4..1c7540e1b8c47d67b8d7b47886ed90d661b10697 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h
@@ -37,13 +37,15 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
State(bool user_input_in_progress,
const string16& user_text,
const string16& keyword,
- bool is_keyword_hint);
+ bool is_keyword_hint,
+ bool is_caret_visible);
~State();
bool user_input_in_progress;
const string16 user_text;
const string16 keyword;
const bool is_keyword_hint;
+ const bool is_caret_visible;
};
OmniboxEditModel(OmniboxView* view,
@@ -190,6 +192,7 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
size_t index);
bool has_focus() const { return has_focus_; }
+ bool is_caret_visible() const { return is_caret_visible_; }
// Accessors for keyword-related state (see comments on keyword_ and
// is_keyword_hint_).
@@ -213,6 +216,12 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
// control key is down (at the time we're gaining focus).
void OnSetFocus(bool control_down);
+ // Sets the visibility of the caret in the omnibox, if it has focus. The
+ // visibility of the caret is reset (to visible) if the omnibox loses focus or
+ // if it is explicitly given focus again. Caret visibility is tracked per-tab
+ // and updates automatically upon switching tabs.
+ void SetCaretVisibility(bool visible);
+
// Sent before |OnKillFocus| and before the popup is closed.
void OnWillKillFocus(gfx::NativeView view_gaining_focus);
@@ -404,6 +413,9 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
// Whether the edit has focus.
bool has_focus_;
+ // Is the caret visible? Only meaningful if has_focus_ is true.
+ bool is_caret_visible_;
+
// The URL of the currently displayed page.
string16 permanent_text_;

Powered by Google App Engine
This is Rietveld 408576698