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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_edit_model.h

Issue 11414303: Make Google Search autocomplete provider cursor aware. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years 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 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // not yet accepted them. We use this to determine when we need to save 411 // not yet accepted them. We use this to determine when we need to save
412 // state (on switching tabs) and whether changes to the page URL should be 412 // state (on switching tabs) and whether changes to the page URL should be
413 // immediately displayed. 413 // immediately displayed.
414 // This flag will be true in a superset of the cases where the popup is open. 414 // This flag will be true in a superset of the cases where the popup is open.
415 bool user_input_in_progress_; 415 bool user_input_in_progress_;
416 416
417 // The text that the user has entered. This does not include inline 417 // The text that the user has entered. This does not include inline
418 // autocomplete text that has not yet been accepted. 418 // autocomplete text that has not yet been accepted.
419 string16 user_text_; 419 string16 user_text_;
420 420
421 // The 0-based position of the cursor within |user_text_| or string16::npos
422 // if unknown or past the last character.
423 size_t cursor_position_;
Peter Kasting 2012/12/05 20:49:38 I don't think we need to track this as a member (o
Bart N. 2012/12/06 21:43:32 Great suggestion, thanks! I wonder why it is end r
Peter Kasting 2012/12/06 22:16:35 Well, think about how you create a selection (with
424
421 // We keep track of when the user began modifying the omnibox text. 425 // We keep track of when the user began modifying the omnibox text.
422 // This should be valid whenever user_input_in_progress_ is true. 426 // This should be valid whenever user_input_in_progress_ is true.
423 base::TimeTicks time_user_first_modified_omnibox_; 427 base::TimeTicks time_user_first_modified_omnibox_;
424 428
425 // When the user closes the popup, we need to remember the URL for their 429 // When the user closes the popup, we need to remember the URL for their
426 // desired choice, so that if they hit enter without reopening the popup we 430 // desired choice, so that if they hit enter without reopening the popup we
427 // know where to go. We could simply rerun autocomplete in this case, but 431 // know where to go. We could simply rerun autocomplete in this case, but
428 // we'd need to either wait for all results to come in (unacceptably slow) or 432 // we'd need to either wait for all results to come in (unacceptably slow) or
429 // do the wrong thing when the user had chosen some provider whose results 433 // do the wrong thing when the user had chosen some provider whose results
430 // were not returned instantaneously. 434 // were not returned instantaneously.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // an exact keyword match. If this is true then keyword mode will be 508 // an exact keyword match. If this is true then keyword mode will be
505 // triggered automatically if the input is "<keyword> <search string>". We 509 // triggered automatically if the input is "<keyword> <search string>". We
506 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. 510 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true.
507 // This has no effect if we're already in keyword mode. 511 // This has no effect if we're already in keyword mode.
508 bool allow_exact_keyword_match_; 512 bool allow_exact_keyword_match_;
509 513
510 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); 514 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel);
511 }; 515 };
512 516
513 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ 517 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698