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

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

Issue 795343002: Omnibox Watcher: Don't Flag Incidents that are Paste+Enter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rlz unittest Created 6 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
« no previous file with comments | « chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc ('k') | 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 "chrome/browser/ui/omnibox/omnibox_edit_model.h" 5 #include "chrome/browser/ui/omnibox/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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 ACMatches fake_single_entry_matches; 748 ACMatches fake_single_entry_matches;
749 fake_single_entry_matches.push_back(match); 749 fake_single_entry_matches.push_back(match);
750 AutocompleteResult fake_single_entry_result; 750 AutocompleteResult fake_single_entry_result;
751 fake_single_entry_result.AppendMatches(fake_single_entry_matches); 751 fake_single_entry_result.AppendMatches(fake_single_entry_matches);
752 OmniboxLog log( 752 OmniboxLog log(
753 input_text, 753 input_text,
754 just_deleted_text_, 754 just_deleted_text_,
755 input_.type(), 755 input_.type(),
756 popup_model()->IsOpen(), 756 popup_model()->IsOpen(),
757 (!popup_model()->IsOpen() || !pasted_text.empty()) ? 0 : index, 757 (!popup_model()->IsOpen() || !pasted_text.empty()) ? 0 : index,
758 !pasted_text.empty(), 758 !pasted_text.empty(), // is_paste_and_go
759 paste_state_ != NONE, // last_action_was_paste
759 -1, // don't yet know tab ID; set later if appropriate 760 -1, // don't yet know tab ID; set later if appropriate
760 ClassifyPage(), 761 ClassifyPage(),
761 elapsed_time_since_user_first_modified_omnibox, 762 elapsed_time_since_user_first_modified_omnibox,
762 match.allowed_to_be_default_match ? match.inline_autocompletion.length() : 763 match.allowed_to_be_default_match ? match.inline_autocompletion.length() :
763 base::string16::npos, 764 base::string16::npos,
764 elapsed_time_since_last_change_to_default_match, 765 elapsed_time_since_last_change_to_default_match,
765 (!popup_model()->IsOpen() || !pasted_text.empty()) ? 766 (!popup_model()->IsOpen() || !pasted_text.empty()) ?
766 fake_single_entry_result : result()); 767 fake_single_entry_result : result());
767 DCHECK(!popup_model()->IsOpen() || !pasted_text.empty() || 768 DCHECK(!popup_model()->IsOpen() || !pasted_text.empty() ||
768 (log.elapsed_time_since_user_first_modified_omnibox >= 769 (log.elapsed_time_since_user_first_modified_omnibox >=
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 // Update state and notify view if the omnibox has focus and the caret 1475 // Update state and notify view if the omnibox has focus and the caret
1475 // visibility changed. 1476 // visibility changed.
1476 const bool was_caret_visible = is_caret_visible(); 1477 const bool was_caret_visible = is_caret_visible();
1477 focus_state_ = state; 1478 focus_state_ = state;
1478 if (focus_state_ != OMNIBOX_FOCUS_NONE && 1479 if (focus_state_ != OMNIBOX_FOCUS_NONE &&
1479 is_caret_visible() != was_caret_visible) 1480 is_caret_visible() != was_caret_visible)
1480 view_->ApplyCaretVisibility(); 1481 view_->ApplyCaretVisibility();
1481 1482
1482 delegate_->OnFocusChanged(focus_state_, reason); 1483 delegate_->OnFocusChanged(focus_state_, reason);
1483 } 1484 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698