| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/metrics/proto/omnibox_event.pb.h" | 16 #include "components/metrics/proto/omnibox_event.pb.h" |
| 17 #include "components/omnibox/browser/autocomplete_controller.h" |
| 17 #include "components/omnibox/browser/autocomplete_controller_delegate.h" | 18 #include "components/omnibox/browser/autocomplete_controller_delegate.h" |
| 18 #include "components/omnibox/browser/autocomplete_input.h" | 19 #include "components/omnibox/browser/autocomplete_input.h" |
| 19 #include "components/omnibox/browser/autocomplete_match.h" | 20 #include "components/omnibox/browser/autocomplete_match.h" |
| 20 #include "components/omnibox/browser/omnibox_controller.h" | 21 #include "components/omnibox/browser/omnibox_controller.h" |
| 21 #include "components/omnibox/browser/omnibox_view.h" | 22 #include "components/omnibox/browser/omnibox_view.h" |
| 22 #include "components/omnibox/common/omnibox_focus_state.h" | 23 #include "components/omnibox/common/omnibox_focus_state.h" |
| 23 #include "ui/base/window_open_disposition.h" | 24 #include "ui/base/window_open_disposition.h" |
| 24 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
| 25 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 26 | 27 |
| 27 class AutocompleteController; | |
| 28 class AutocompleteResult; | 28 class AutocompleteResult; |
| 29 class OmniboxClient; | 29 class OmniboxClient; |
| 30 class OmniboxEditController; | 30 class OmniboxEditController; |
| 31 class OmniboxPopupModel; | 31 class OmniboxPopupModel; |
| 32 class OmniboxView; | 32 class OmniboxView; |
| 33 | 33 |
| 34 namespace gfx { | 34 namespace gfx { |
| 35 class Image; | 35 class Image; |
| 36 class Rect; | 36 class Rect; |
| 37 } | 37 } |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // contents/selection have changed since it was | 373 // contents/selection have changed since it was |
| 374 // depressed. If the user now hits enter, we assume | 374 // depressed. If the user now hits enter, we assume |
| 375 // he simply hasn't released the key, rather than that | 375 // he simply hasn't released the key, rather than that |
| 376 // he intended to hit "ctrl-enter". | 376 // he intended to hit "ctrl-enter". |
| 377 }; | 377 }; |
| 378 | 378 |
| 379 // Returns true if a query to an autocomplete provider is currently | 379 // Returns true if a query to an autocomplete provider is currently |
| 380 // in progress. This logic should in the future live in | 380 // in progress. This logic should in the future live in |
| 381 // AutocompleteController but resides here for now. This method is used by | 381 // AutocompleteController but resides here for now. This method is used by |
| 382 // AutomationProvider::AutocompleteEditIsQueryInProgress. | 382 // AutomationProvider::AutocompleteEditIsQueryInProgress. |
| 383 bool query_in_progress() const; | 383 bool query_in_progress() const { return !autocomplete_controller()->done(); } |
| 384 |
| 385 // Returns true if the popup exists and is open. (This is a convenience |
| 386 // wrapper for the benefit of test code, which may not have a popup model.) |
| 387 bool PopupIsOpen() const; |
| 384 | 388 |
| 385 // Called whenever user_text_ should change. | 389 // Called whenever user_text_ should change. |
| 386 void InternalSetUserText(const base::string16& text); | 390 void InternalSetUserText(const base::string16& text); |
| 387 | 391 |
| 388 // Turns off keyword mode for the current match. | 392 // Turns off keyword mode for the current match. |
| 389 void ClearPopupKeywordMode() const; | 393 void ClearPopupKeywordMode() const; |
| 390 | 394 |
| 391 // Conversion between user text and display text. User text is the text the | 395 // Conversion between user text and display text. User text is the text the |
| 392 // user has input. Display text is the text being shown in the edit. The | 396 // user has input. Display text is the text being shown in the edit. The |
| 393 // two are different if a keyword is selected. | 397 // two are different if a keyword is selected. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 572 |
| 569 // The input that was sent to the AutocompleteController. Since no | 573 // The input that was sent to the AutocompleteController. Since no |
| 570 // autocomplete query is started after a tab switch, it is possible for this | 574 // autocomplete query is started after a tab switch, it is possible for this |
| 571 // |input_| to differ from the one currently stored in AutocompleteController. | 575 // |input_| to differ from the one currently stored in AutocompleteController. |
| 572 AutocompleteInput input_; | 576 AutocompleteInput input_; |
| 573 | 577 |
| 574 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 578 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
| 575 }; | 579 }; |
| 576 | 580 |
| 577 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 581 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
| OLD | NEW |