Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 545 AutocompleteLog log( | 545 AutocompleteLog log( |
| 546 autocomplete_controller_->input().text(), | 546 autocomplete_controller_->input().text(), |
| 547 just_deleted_text_, | 547 just_deleted_text_, |
| 548 autocomplete_controller_->input().type(), | 548 autocomplete_controller_->input().type(), |
| 549 popup_->selected_line(), | 549 popup_->selected_line(), |
| 550 -1, // don't yet know tab ID; set later if appropriate | 550 -1, // don't yet know tab ID; set later if appropriate |
| 551 ClassifyPage(controller_->GetTabContents()-> | 551 ClassifyPage(controller_->GetTabContents()-> |
| 552 web_contents()->GetURL()), | 552 web_contents()->GetURL()), |
| 553 base::TimeTicks::Now() - time_user_first_modified_omnibox_, | 553 base::TimeTicks::Now() - time_user_first_modified_omnibox_, |
| 554 string16::npos, // inline autocomplete length; possibly set later | 554 string16::npos, // inline autocomplete length; possibly set later |
| 555 base::TimeTicks::Now() - | |
|
Bart N.
2012/11/19 18:02:21
There is some inconsistency here, because you call
Mark P
2012/11/19 22:21:45
I was wondering if someone would call me out on th
| |
| 556 autocomplete_controller_->last_time_default_match_changed(), | |
| 555 result()); | 557 result()); |
| 556 DCHECK(user_input_in_progress_ || | 558 DCHECK(user_input_in_progress_ || |
| 557 match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) | 559 match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) |
| 558 << "We didn't get here through the expected series of calls. " | 560 << "We didn't get here through the expected series of calls. " |
| 559 << "time_user_first_modified_omnibox_ is not set correctly and other " | 561 << "time_user_first_modified_omnibox_ is not set correctly and other " |
| 560 << "things may be wrong. Match provider: " << match.provider->GetName(); | 562 << "things may be wrong. Match provider: " << match.provider->GetName(); |
| 563 DCHECK(log.elapsed_time_since_user_first_modified_omnibox >= | |
|
Peter Kasting
2012/11/16 23:57:18
Nit: DCHECK_GE
Mark P
2012/11/19 22:21:45
Can't use a DCHECK_GE because DCHECK using << to d
| |
| 564 log.elapsed_time_since_last_change_to_default_match) | |
| 565 << "We should've got the notification that the user modified the " | |
| 566 << "omnibox text at same time or before the most recent time the " | |
| 567 << "default match changed."; | |
| 561 if (index != OmniboxPopupModel::kNoMatch) | 568 if (index != OmniboxPopupModel::kNoMatch) |
| 562 log.selected_index = index; | 569 log.selected_index = index; |
| 563 else if (!has_temporary_text_) | 570 else if (!has_temporary_text_) |
| 564 log.inline_autocompleted_length = inline_autocomplete_text_.length(); | 571 log.inline_autocompleted_length = inline_autocomplete_text_.length(); |
| 565 if (disposition == CURRENT_TAB) { | 572 if (disposition == CURRENT_TAB) { |
| 566 // If we know the destination is being opened in the current tab, | 573 // If we know the destination is being opened in the current tab, |
| 567 // we can easily get the tab ID. (If it's being opened in a new | 574 // we can easily get the tab ID. (If it's being opened in a new |
| 568 // tab, we don't know the tab ID yet.) | 575 // tab, we don't know the tab ID yet.) |
| 569 log.tab_id = SessionTabHelper::FromWebContents( | 576 log.tab_id = SessionTabHelper::FromWebContents( |
| 570 controller_->GetTabContents()->web_contents())->session_id().id(); | 577 controller_->GetTabContents()->web_contents())->session_id().id(); |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1288 } | 1295 } |
| 1289 | 1296 |
| 1290 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1297 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
| 1291 const string16& text, | 1298 const string16& text, |
| 1292 AutocompleteMatch* match, | 1299 AutocompleteMatch* match, |
| 1293 GURL* alternate_nav_url) const { | 1300 GURL* alternate_nav_url) const { |
| 1294 DCHECK(match); | 1301 DCHECK(match); |
| 1295 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1302 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
| 1296 string16(), false, false, match, alternate_nav_url); | 1303 string16(), false, false, match, alternate_nav_url); |
| 1297 } | 1304 } |
| OLD | NEW |