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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 11369137: Implement {Start,Stop}CapturingKeyStrokes for Instant. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Keep invisible focus state in OmniboxEditModel. Created 8 years, 1 month 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/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index f4c00643fe23d73adee5ea7d4e4f7071a42908bf..a02d6652db8d97efb0634d242bafd2f1d4f6215a 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -569,6 +569,13 @@ void OmniboxViewViews::UpdatePopup() {
}
void OmniboxViewViews::SetFocus() {
+ SetFocusVisibility(true);
+ // In views-implementation, the focus is on textfield rather than OmniboxView.
+ textfield_->RequestFocus();
+}
+
+void OmniboxViewViews::SetInvisibleFocus() {
+ SetFocusVisibility(false);
// In views-implementation, the focus is on textfield rather than OmniboxView.
textfield_->RequestFocus();
}
@@ -599,6 +606,7 @@ void OmniboxViewViews::OnRevertTemporaryText() {
}
void OmniboxViewViews::OnBeforePossibleChange() {
+ SetFocusVisibility(true);
// Record our state.
text_before_change_ = GetText();
textfield_->GetSelectedRange(&sel_before_change_);
@@ -936,3 +944,8 @@ void OmniboxViewViews::OnPaste() {
textfield_->ReplaceSelection(text);
}
}
+
+void OmniboxViewViews::SetFocusVisibility(bool focus_is_visible) {
+ model()->OnFocusVisibilityChange(focus_is_visible);
+ // TODO(mathp): actually make focus invisible
+}

Powered by Google App Engine
This is Rietveld 408576698