| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 GURL* alternate_nav_url) const; | 371 GURL* alternate_nav_url) const; |
| 372 | 372 |
| 373 // Returns true if |text| (which is display text in the current context) | 373 // Returns true if |text| (which is display text in the current context) |
| 374 // parses as a URL, and in that case sets |url| to the calculated URL. | 374 // parses as a URL, and in that case sets |url| to the calculated URL. |
| 375 // Subtle note: This ignores the desired_tld_ (unlike GetDataForURLExport() | 375 // Subtle note: This ignores the desired_tld_ (unlike GetDataForURLExport() |
| 376 // and CurrentTextIsURL()). The view needs this because it calls this | 376 // and CurrentTextIsURL()). The view needs this because it calls this |
| 377 // function during copy handling, when the control key is down to trigger the | 377 // function during copy handling, when the control key is down to trigger the |
| 378 // copy. | 378 // copy. |
| 379 bool GetURLForText(const string16& text, GURL* url) const; | 379 bool GetURLForText(const string16& text, GURL* url) const; |
| 380 | 380 |
| 381 // Reverts the edit box from a temporary text back to the original user text. |
| 382 // If |revert_popup| is true then the popup will be reverted as well. |
| 383 void RevertTemporaryText(bool revert_popup); |
| 384 |
| 381 // Accepts current keyword if the user only typed a space at the end of | 385 // Accepts current keyword if the user only typed a space at the end of |
| 382 // |new_user_text| comparing to the |old_user_text|. | 386 // |new_user_text| comparing to the |old_user_text|. |
| 383 // Returns true if the current keyword is accepted. | 387 // Returns true if the current keyword is accepted. |
| 384 bool MaybeAcceptKeywordBySpace(const string16& old_user_text, | 388 bool MaybeAcceptKeywordBySpace(const string16& old_user_text, |
| 385 const string16& new_user_text); | 389 const string16& new_user_text); |
| 386 | 390 |
| 387 // Checks if a given character is a valid space character for accepting | 391 // Checks if a given character is a valid space character for accepting |
| 388 // keyword. | 392 // keyword. |
| 389 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); | 393 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); |
| 390 | 394 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 mutable GURL paste_and_go_url_; | 486 mutable GURL paste_and_go_url_; |
| 483 mutable PageTransition::Type paste_and_go_transition_; | 487 mutable PageTransition::Type paste_and_go_transition_; |
| 484 mutable GURL paste_and_go_alternate_nav_url_; | 488 mutable GURL paste_and_go_alternate_nav_url_; |
| 485 | 489 |
| 486 Profile* profile_; | 490 Profile* profile_; |
| 487 | 491 |
| 488 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 492 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
| 489 }; | 493 }; |
| 490 | 494 |
| 491 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 495 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
| OLD | NEW |