| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // user hasn't actually selected a keyword yet. When this is true, we can use | 522 // user hasn't actually selected a keyword yet. When this is true, we can use |
| 523 // keyword_ to show a "Press <tab> to search" sort of hint. | 523 // keyword_ to show a "Press <tab> to search" sort of hint. |
| 524 bool is_keyword_hint_; | 524 bool is_keyword_hint_; |
| 525 | 525 |
| 526 // Paste And Go-related state. See CanPasteAndGo(). | 526 // Paste And Go-related state. See CanPasteAndGo(). |
| 527 mutable AutocompleteMatch paste_and_go_match_; | 527 mutable AutocompleteMatch paste_and_go_match_; |
| 528 mutable GURL paste_and_go_alternate_nav_url_; | 528 mutable GURL paste_and_go_alternate_nav_url_; |
| 529 | 529 |
| 530 Profile* profile_; | 530 Profile* profile_; |
| 531 | 531 |
| 532 // Should instant be updated? This is needed as prior to accepting the current | 532 // This is needed as prior to accepting the current text the model is |
| 533 // text the model is reverted, which triggers resetting instant. We don't want | 533 // reverted, which triggers resetting instant. We don't want to update instant |
| 534 // to update instant in this case, so we use the flag to determine if this is | 534 // in this case, so we use the flag to determine if this is happening. |
| 535 // happening. | 535 bool in_revert_; |
| 536 bool update_instant_; | |
| 537 | 536 |
| 538 // Indicates if the upcoming autocomplete search is allowed to be treated as | 537 // Indicates if the upcoming autocomplete search is allowed to be treated as |
| 539 // an exact keyword match. If it's true then keyword mode will be triggered | 538 // an exact keyword match. If it's true then keyword mode will be triggered |
| 540 // automatically if the input is "<keyword> <search string>". We only allow | 539 // automatically if the input is "<keyword> <search string>". We only allow |
| 541 // such trigger when: | 540 // such trigger when: |
| 542 // 1.A single space character is added at the end of a keyword, such as: | 541 // 1.A single space character is added at the end of a keyword, such as: |
| 543 // (assume "foo" is a keyword, | is the input caret) | 542 // (assume "foo" is a keyword, | is the input caret) |
| 544 // foo| -> foo | | 543 // foo| -> foo | |
| 545 // foo[bar] -> foo | ([bar] indicates a selected text "bar") | 544 // foo[bar] -> foo | ([bar] indicates a selected text "bar") |
| 546 // 2.A single space character is inserted after a keyword when the caret is | 545 // 2.A single space character is inserted after a keyword when the caret is |
| 547 // not at the end of the line, such as: | 546 // not at the end of the line, such as: |
| 548 // foo|bar -> foo |bar | 547 // foo|bar -> foo |bar |
| 549 // | 548 // |
| 550 // It has no effect if a keyword is already selected. | 549 // It has no effect if a keyword is already selected. |
| 551 bool allow_exact_keyword_match_; | 550 bool allow_exact_keyword_match_; |
| 552 | 551 |
| 553 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. | 552 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. |
| 554 InstantCompleteBehavior instant_complete_behavior_; | 553 InstantCompleteBehavior instant_complete_behavior_; |
| 555 | 554 |
| 556 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 555 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
| 557 }; | 556 }; |
| 558 | 557 |
| 559 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 558 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
| OLD | NEW |