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 f8444f67bb086fe528660a87a103a257bdf3e1f8..b8bcd4d2f710fa96feaa938be31b8090bf205da1 100644 |
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h |
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h |
@@ -12,6 +12,7 @@ |
#include "base/time.h" |
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
#include "chrome/browser/autocomplete/autocomplete_match.h" |
+#include "chrome/common/instant_types.h" |
#include "chrome/common/metrics/proto/omnibox_event.pb.h" |
#include "content/public/common/page_transition_types.h" |
#include "googleurl/src/gurl.h" |
@@ -223,6 +224,12 @@ class OmniboxEditModel : public AutocompleteControllerDelegate { |
// - User clicks in the omnibox |
// - Omnibox loses and then regains focus |
// - SetFocus() is explicitly called again |
Peter Kasting
2012/12/06 06:02:30
Nit: SetFocus() -> OmniboxView::SetFocus() ?
samarth
2012/12/06 16:15:50
Done.
|
+ // Note that the last two cases often overlap but can happen independently of |
+ // each other and so must both be dealt with individually. (For example, if |
+ // you tab into the omnibox, OnSetFocus will be called but not SetFocus. If |
+ // the omnibox has invisible focus and you open a second tab, SetFocus will be |
+ // called but not OnSetFocus.) |
Peter Kasting
2012/12/06 06:02:30
Rather than write so much here, perhaps we need mo
|
+ // |
// Caret visibility is tracked per-tab and updates automatically upon |
// switching tabs. |
void SetCaretVisibility(bool visible); |
@@ -407,6 +414,11 @@ class OmniboxEditModel : public AutocompleteControllerDelegate { |
AutocompleteMatch* match, |
GURL* alternate_nav_url) const; |
+ // Helper for SetCaretVisibility. |reason| is the reason for change that is |
+ // passed down to InstantController when we notify it of focus state changes. |
+ void SetCaretVisibilityInternal(bool visible, |
+ OmniboxFocusChangeReason reason); |
+ |
scoped_ptr<AutocompleteController> autocomplete_controller_; |
OmniboxView* view_; |