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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // TODO(pkasting): When manually_selected_match_ moves to the controller, this | 394 // TODO(pkasting): When manually_selected_match_ moves to the controller, this |
395 // can move too. | 395 // can move too. |
396 void InfoForCurrentSelection(AutocompleteMatch* match, | 396 void InfoForCurrentSelection(AutocompleteMatch* match, |
397 GURL* alternate_nav_url) const; | 397 GURL* alternate_nav_url) const; |
398 | 398 |
399 // Returns the default match for the current text, as well as the alternate | 399 // Returns the default match for the current text, as well as the alternate |
400 // nav URL, if |alternate_nav_url| is non-NULL and there is such a URL. | 400 // nav URL, if |alternate_nav_url| is non-NULL and there is such a URL. |
401 void GetInfoForCurrentText(AutocompleteMatch* match, | 401 void GetInfoForCurrentText(AutocompleteMatch* match, |
402 GURL* alternate_nav_url) const; | 402 GURL* alternate_nav_url) const; |
403 | 403 |
404 // Returns true if |text| (which is display text in the current context) | |
405 // parses as a URL, and in that case sets |url| to the calculated URL. | |
406 // Subtle note: This ignores the desired_tld_ (unlike GetDataForURLExport() | |
407 // and CurrentTextIsURL()). The view needs this because it calls this | |
408 // function during copy handling, when the control key is down to trigger the | |
409 // copy. | |
410 bool GetURLForText(const string16& text, GURL* url) const; | |
411 | |
412 // Reverts the edit box from a temporary text back to the original user text. | 404 // Reverts the edit box from a temporary text back to the original user text. |
413 // If |revert_popup| is true then the popup will be reverted as well. | 405 // If |revert_popup| is true then the popup will be reverted as well. |
414 void RevertTemporaryText(bool revert_popup); | 406 void RevertTemporaryText(bool revert_popup); |
415 | 407 |
416 // Accepts current keyword if the user only typed a space at the end of | 408 // Accepts current keyword if the user only typed a space at the end of |
417 // |new_user_text| comparing to the |old_user_text|. | 409 // |new_user_text| comparing to the |old_user_text|. |
418 // Returns true if the current keyword is accepted. | 410 // Returns true if the current keyword is accepted. |
419 bool MaybeAcceptKeywordBySpace(const string16& old_user_text, | 411 bool MaybeAcceptKeywordBySpace(const string16& old_user_text, |
420 const string16& new_user_text); | 412 const string16& new_user_text); |
421 | 413 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // It has no effect if a keyword is already selected. | 552 // It has no effect if a keyword is already selected. |
561 bool allow_exact_keyword_match_; | 553 bool allow_exact_keyword_match_; |
562 | 554 |
563 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. | 555 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. |
564 InstantCompleteBehavior instant_complete_behavior_; | 556 InstantCompleteBehavior instant_complete_behavior_; |
565 | 557 |
566 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 558 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
567 }; | 559 }; |
568 | 560 |
569 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 561 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |