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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 // not yet accepted them. We use this to determine when we need to save | 437 // not yet accepted them. We use this to determine when we need to save |
| 438 // state (on switching tabs) and whether changes to the page URL should be | 438 // state (on switching tabs) and whether changes to the page URL should be |
| 439 // immediately displayed. | 439 // immediately displayed. |
| 440 // This flag will be true in a superset of the cases where the popup is open. | 440 // This flag will be true in a superset of the cases where the popup is open. |
| 441 bool user_input_in_progress_; | 441 bool user_input_in_progress_; |
| 442 | 442 |
| 443 // The text that the user has entered. This does not include inline | 443 // The text that the user has entered. This does not include inline |
| 444 // autocomplete text that has not yet been accepted. | 444 // autocomplete text that has not yet been accepted. |
| 445 string16 user_text_; | 445 string16 user_text_; |
| 446 | 446 |
| 447 // We keep track of when the user last focused on the omnibox, but reset it | |
| 448 // when user input occurs. | |
|
Mark P
2013/07/09 19:49:47
Please say explicitly reset it to null.
H Fung
2013/07/09 20:33:03
Done.
| |
| 449 base::TimeTicks last_omnibox_focus_without_user_input_; | |
| 450 | |
| 447 // We keep track of when the user began modifying the omnibox text. | 451 // We keep track of when the user began modifying the omnibox text. |
| 448 // This should be valid whenever user_input_in_progress_ is true. | 452 // This should be valid whenever user_input_in_progress_ is true. |
| 449 base::TimeTicks time_user_first_modified_omnibox_; | 453 base::TimeTicks time_user_first_modified_omnibox_; |
| 450 | 454 |
| 451 // When the user closes the popup, we need to remember the URL for their | 455 // When the user closes the popup, we need to remember the URL for their |
| 452 // desired choice, so that if they hit enter without reopening the popup we | 456 // desired choice, so that if they hit enter without reopening the popup we |
| 453 // know where to go. We could simply rerun autocomplete in this case, but | 457 // know where to go. We could simply rerun autocomplete in this case, but |
| 454 // we'd need to either wait for all results to come in (unacceptably slow) or | 458 // we'd need to either wait for all results to come in (unacceptably slow) or |
| 455 // do the wrong thing when the user had chosen some provider whose results | 459 // do the wrong thing when the user had chosen some provider whose results |
| 456 // were not returned instantaneously. | 460 // were not returned instantaneously. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 // an exact keyword match. If this is true then keyword mode will be | 565 // an exact keyword match. If this is true then keyword mode will be |
| 562 // triggered automatically if the input is "<keyword> <search string>". We | 566 // triggered automatically if the input is "<keyword> <search string>". We |
| 563 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. | 567 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. |
| 564 // This has no effect if we're already in keyword mode. | 568 // This has no effect if we're already in keyword mode. |
| 565 bool allow_exact_keyword_match_; | 569 bool allow_exact_keyword_match_; |
| 566 | 570 |
| 567 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 571 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
| 568 }; | 572 }; |
| 569 | 573 |
| 570 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 574 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| OLD | NEW |