| 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/autocomplete/autocomplete_edit.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 -1, // don't yet know tab ID; set later if appropriate | 520 -1, // don't yet know tab ID; set later if appropriate |
| 521 base::TimeDelta::FromMilliseconds(-1), // typing duration; usually | 521 base::TimeDelta::FromMilliseconds(-1), // typing duration; usually |
| 522 // over-written later | 522 // over-written later |
| 523 0, // inline autocomplete length; possibly set later | 523 0, // inline autocomplete length; possibly set later |
| 524 result()); | 524 result()); |
| 525 if (index != AutocompletePopupModel::kNoMatch) | 525 if (index != AutocompletePopupModel::kNoMatch) |
| 526 log.selected_index = index; | 526 log.selected_index = index; |
| 527 else if (!has_temporary_text_) | 527 else if (!has_temporary_text_) |
| 528 log.inline_autocompleted_length = inline_autocomplete_text_.length(); | 528 log.inline_autocompleted_length = inline_autocomplete_text_.length(); |
| 529 if (disposition == CURRENT_TAB) { | 529 if (disposition == CURRENT_TAB) { |
| 530 // If we know the destination is being opened in the curren tab, | 530 // If we know the destination is being opened in the current tab, |
| 531 // we can easily get the tab ID. (If it's being opened in a new | 531 // we can easily get the tab ID. (If it's being opened in a new |
| 532 // tab, we don't know the tab ID yet.) | 532 // tab, we don't know the tab ID yet.) |
| 533 log.tab_id = controller_->GetTabContentsWrapper()-> | 533 log.tab_id = controller_->GetTabContentsWrapper()-> |
| 534 restore_tab_helper()->session_id().id(); | 534 restore_tab_helper()->session_id().id(); |
| 535 } | 535 } |
| 536 if (user_input_in_progress_) { | 536 if (user_input_in_progress_) { |
| 537 // This case should happen every time except possibly in unit tests. | 537 // This case should happen every time except possibly in unit tests. |
| 538 // If we somehow got into OpenMatch() by selecting an autocomplete | 538 // If we somehow got into OpenMatch() by selecting an autocomplete |
| 539 // match without going through user_input_in_progress_, that | 539 // match without going through user_input_in_progress_, that |
| 540 // means we never properly set time_user_first_modified_omnibox_ | 540 // means we never properly set time_user_first_modified_omnibox_ |
| 541 // (because we didn't know the user started typing!). In that | 541 // (because we didn't know the user started typing!). In that |
| 542 // case, leave the elapsed_time_since_user_first_modified_omnibox | 542 // case, leave the elapsed_time_since_user_first_modified_omnibox |
| 543 // set to -1 ms. | 543 // set to -1 ms. |
| 544 log.elapsed_time_since_user_first_modified_omnibox = | 544 log.elapsed_time_since_user_first_modified_omnibox = |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 // static | 1113 // static |
| 1114 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 1114 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
| 1115 switch (c) { | 1115 switch (c) { |
| 1116 case 0x0020: // Space | 1116 case 0x0020: // Space |
| 1117 case 0x3000: // Ideographic Space | 1117 case 0x3000: // Ideographic Space |
| 1118 return true; | 1118 return true; |
| 1119 default: | 1119 default: |
| 1120 return false; | 1120 return false; |
| 1121 } | 1121 } |
| 1122 } | 1122 } |
| OLD | NEW |