Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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_ |
| OLD | NEW |