Chromium Code Reviews| 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); |
| } |
| } |