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 #include "components/omnibox/browser/omnibox_edit_model.h" | 5 #include "components/omnibox/browser/omnibox_edit_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 } | 669 } |
670 // If the popup is closed or this is a paste-and-go action (meaning the | 670 // If the popup is closed or this is a paste-and-go action (meaning the |
671 // contents of the dropdown are ignored regardless), we record for logging | 671 // contents of the dropdown are ignored regardless), we record for logging |
672 // purposes a selected_index of 0 and a suggestion list as having a single | 672 // purposes a selected_index of 0 and a suggestion list as having a single |
673 // entry of the match used. | 673 // entry of the match used. |
674 ACMatches fake_single_entry_matches; | 674 ACMatches fake_single_entry_matches; |
675 fake_single_entry_matches.push_back(match); | 675 fake_single_entry_matches.push_back(match); |
676 AutocompleteResult fake_single_entry_result; | 676 AutocompleteResult fake_single_entry_result; |
677 fake_single_entry_result.AppendMatches(input_, fake_single_entry_matches); | 677 fake_single_entry_result.AppendMatches(input_, fake_single_entry_matches); |
678 OmniboxLog log( | 678 OmniboxLog log( |
679 input_text, | 679 input_.from_omnibox_focus() ? base::string16() : input_text, |
680 just_deleted_text_, | 680 just_deleted_text_, |
681 input_.type(), | 681 input_.type(), |
682 popup_model()->IsOpen(), | 682 popup_model()->IsOpen(), |
683 (!popup_model()->IsOpen() || !pasted_text.empty()) ? 0 : index, | 683 (!popup_model()->IsOpen() || !pasted_text.empty()) ? 0 : index, |
684 !pasted_text.empty(), | 684 !pasted_text.empty(), |
685 -1, // don't yet know tab ID; set later if appropriate | 685 -1, // don't yet know tab ID; set later if appropriate |
686 ClassifyPage(), | 686 ClassifyPage(), |
687 elapsed_time_since_user_first_modified_omnibox, | 687 elapsed_time_since_user_first_modified_omnibox, |
688 match.allowed_to_be_default_match ? match.inline_autocompletion.length() : | 688 match.allowed_to_be_default_match ? match.inline_autocompletion.length() : |
689 base::string16::npos, | 689 base::string16::npos, |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 // Update state and notify view if the omnibox has focus and the caret | 1447 // Update state and notify view if the omnibox has focus and the caret |
1448 // visibility changed. | 1448 // visibility changed. |
1449 const bool was_caret_visible = is_caret_visible(); | 1449 const bool was_caret_visible = is_caret_visible(); |
1450 focus_state_ = state; | 1450 focus_state_ = state; |
1451 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1451 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
1452 is_caret_visible() != was_caret_visible) | 1452 is_caret_visible() != was_caret_visible) |
1453 view_->ApplyCaretVisibility(); | 1453 view_->ApplyCaretVisibility(); |
1454 | 1454 |
1455 client_->OnFocusChanged(focus_state_, reason); | 1455 client_->OnFocusChanged(focus_state_, reason); |
1456 } | 1456 } |
OLD | NEW |