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

Side by Side Diff: components/omnibox/browser/omnibox_edit_model.cc

Issue 1395613006: Record zero-suggest selections as empty input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698