Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit.h

Issue 6281011: Allow space to accept keyword even when inline autocomplete is available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Accept keyword even with selection. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::wstring& text, GURL* url) const; 379 bool GetURLForText(const std::wstring& text, GURL* url) const;
380 380
381 // Accepts current keyword if the user only typed a space at the end of 381 // Accepts current keyword if the user only typed a space at the end of
382 // |new_user_text|. Returns true if the current keyword is accepted. 382 // |new_user_text| comparing to the |old_user_text|.
383 bool MaybeAcceptKeywordBySpace(const std::wstring& new_user_text); 383 // Returns true if the current keyword is accepted.
384 bool MaybeAcceptKeywordBySpace(const std::wstring& old_user_text,
385 const std::wstring& new_user_text);
384 386
385 // Checks if a given character is a valid space character for accepting 387 // Checks if a given character is a valid space character for accepting
386 // keyword. 388 // keyword.
387 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); 389 static bool IsSpaceCharForAcceptingKeyword(wchar_t c);
388 390
389 AutocompleteEditView* view_; 391 AutocompleteEditView* view_;
390 392
391 AutocompletePopupModel* popup_; 393 AutocompletePopupModel* popup_;
392 394
393 AutocompleteEditController* controller_; 395 AutocompleteEditController* controller_;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 mutable GURL paste_and_go_url_; 482 mutable GURL paste_and_go_url_;
481 mutable PageTransition::Type paste_and_go_transition_; 483 mutable PageTransition::Type paste_and_go_transition_;
482 mutable GURL paste_and_go_alternate_nav_url_; 484 mutable GURL paste_and_go_alternate_nav_url_;
483 485
484 Profile* profile_; 486 Profile* profile_;
485 487
486 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); 488 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel);
487 }; 489 };
488 490
489 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ 491 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit.cc » ('j') | chrome/browser/autocomplete/autocomplete_edit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698