| 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 CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 // which is the URL of the current page. | 505 // which is the URL of the current page. |
| 506 // | 506 // |
| 507 // original_url_ is only valid when there is temporary text, and is used as | 507 // original_url_ is only valid when there is temporary text, and is used as |
| 508 // the unique identifier of the originally selected item. Thus, if the user | 508 // the unique identifier of the originally selected item. Thus, if the user |
| 509 // arrows to a different item with the same text, we can still distinguish | 509 // arrows to a different item with the same text, we can still distinguish |
| 510 // them and not revert all the way to the permanent_text_. | 510 // them and not revert all the way to the permanent_text_. |
| 511 bool has_temporary_text_; | 511 bool has_temporary_text_; |
| 512 GURL original_url_; | 512 GURL original_url_; |
| 513 | 513 |
| 514 // True if Instant set the current temporary text, as opposed to it being set | 514 // True if Instant set the current temporary text, as opposed to it being set |
| 515 // due to the user arrowing up/down through the popup. | 515 // due to the user arrowing up/down through the popup. This can only be true |
| 516 // if |has_temporary_text_| is true. |
| 516 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit | 517 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit |
| 517 // model/view code is decoupled from Instant (among other things). | 518 // model/view code is decoupled from Instant (among other things). |
| 518 bool is_temporary_text_set_by_instant_; | 519 bool is_temporary_text_set_by_instant_; |
| 519 | 520 |
| 521 // True if the current temporary text set by Instant is a search query; false |
| 522 // if it is a URL that can be directly navigated to. This is only valid if |
| 523 // |is_temporary_text_set_by_instant_| is true. This field is needed because |
| 524 // Instant's temporary text doesn't come from the popup model, so we can't |
| 525 // lookup its type from the current match. |
| 526 bool is_instant_temporary_text_a_search_query_; |
| 527 |
| 520 // When the user's last action was to paste, we disallow inline autocomplete | 528 // When the user's last action was to paste, we disallow inline autocomplete |
| 521 // (on the theory that the user is trying to paste in a new URL or part of | 529 // (on the theory that the user is trying to paste in a new URL or part of |
| 522 // one, and in either case inline autocomplete would get in the way). | 530 // one, and in either case inline autocomplete would get in the way). |
| 523 PasteState paste_state_; | 531 PasteState paste_state_; |
| 524 | 532 |
| 525 // Whether the control key is depressed. We track this to avoid calling | 533 // Whether the control key is depressed. We track this to avoid calling |
| 526 // UpdatePopup() repeatedly if the user holds down the key, and to know | 534 // UpdatePopup() repeatedly if the user holds down the key, and to know |
| 527 // whether to trigger "ctrl-enter" behavior. | 535 // whether to trigger "ctrl-enter" behavior. |
| 528 ControlKeyState control_key_state_; | 536 ControlKeyState control_key_state_; |
| 529 | 537 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 554 // an exact keyword match. If this is true then keyword mode will be | 562 // an exact keyword match. If this is true then keyword mode will be |
| 555 // triggered automatically if the input is "<keyword> <search string>". We | 563 // triggered automatically if the input is "<keyword> <search string>". We |
| 556 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. | 564 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. |
| 557 // This has no effect if we're already in keyword mode. | 565 // This has no effect if we're already in keyword mode. |
| 558 bool allow_exact_keyword_match_; | 566 bool allow_exact_keyword_match_; |
| 559 | 567 |
| 560 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 568 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
| 561 }; | 569 }; |
| 562 | 570 |
| 563 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 571 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| OLD | NEW |