| 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..aa4c4d4a79e6b183e19d410fc1356432d4d3d196 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"
|
| @@ -217,12 +218,13 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
|
| 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 any of the following
|
| - // happens:
|
| - // - User starts typing in the omnibox
|
| - // - User clicks in the omnibox
|
| - // - Omnibox loses and then regains focus
|
| - // - SetFocus() is explicitly called again
|
| + // visibility of the caret is reset to visible if either
|
| + // - The user starts typing, or
|
| + // - We explicitly focus the omnibox again.
|
| + // The latter case must be handled in three separate places--OnSetFocus(),
|
| + // OmniboxView::SetFocus(), and the mouse handlers in OmniboxView. See
|
| + // accompanying comments for why each of these is necessary.
|
| + //
|
| // Caret visibility is tracked per-tab and updates automatically upon
|
| // switching tabs.
|
| void SetCaretVisibility(bool visible);
|
| @@ -407,6 +409,12 @@ class OmniboxEditModel : public AutocompleteControllerDelegate {
|
| AutocompleteMatch* match,
|
| GURL* alternate_nav_url) const;
|
|
|
| + // Actually changes the current caret visibility. When the new visibility
|
| + // doesn't match the old, we notify the InstantController about the change and
|
| + // pass |reason| to it.
|
| + void SetCaretVisibilityInternal(bool visible,
|
| + OmniboxFocusChangeReason reason);
|
| +
|
| scoped_ptr<AutocompleteController> autocomplete_controller_;
|
|
|
| OmniboxView* view_;
|
|
|