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

Unified Diff: chrome/browser/ui/search/instant_controller.cc

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: 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
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_page.h » ('j') | chrome/renderer/searchbox/searchbox.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_controller.cc
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc
index 02ba4d3c6a367e313050d415e01b35bf01b8838f..89224e263170a01caf9bc9171ec2284e15756411 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -944,17 +944,32 @@ void InstantController::OmniboxFocusChanged(
instant_tab_->KeyCaptureChanged(is_key_capture_enabled);
}
+ bool focus_changed = false;
if (state == OMNIBOX_FOCUS_VISIBLE && old_focus_state == OMNIBOX_FOCUS_NONE) {
// If the user explicitly focused the omnibox, then create the overlay if
// it doesn't exist. If we're using a fallback overlay, try loading the
// remote overlay again.
if (!overlay_ || (overlay_->IsLocal() && !use_local_page_only_))
ResetOverlay(GetInstantURL());
+ focus_changed = true;
} else if (state == OMNIBOX_FOCUS_NONE &&
old_focus_state != OMNIBOX_FOCUS_NONE) {
// If the focus went from the omnibox to outside the omnibox, commit or
// discard the overlay.
OmniboxLostFocus(view_gaining_focus);
+ focus_changed = true;
+ }
melevin 2013/05/09 16:41:11 Instead of using the "focus_changed" variable you
Donn Denman 2013/05/13 18:00:39 Given Samarth's comments, I think this will no lon
+
+ // If the focus changed, notify the page.
+ if (focus_changed && state != OMNIBOX_FOCUS_INVISIBLE) {
samarth 2013/05/10 00:55:32 We should do the "did focus actually change" check
Donn Denman 2013/05/13 18:00:39 Done.
+ // TODO(donnd): fix multiple notifications clicking the Google search box.
+ bool is_focused = omnibox_focus_state_ == OMNIBOX_FOCUS_VISIBLE;
+ if (overlay_)
+ overlay_->FocusChanged(is_focused);
+ if (ntp_)
+ ntp_->FocusChanged(is_focused);
+ if (instant_tab_)
+ instant_tab_->FocusChanged(is_focused);
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_page.h » ('j') | chrome/renderer/searchbox/searchbox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698