| OLD | NEW | 
|    1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2011 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  422  |  422  | 
|  423     if (template_url) { |  423     if (template_url) { | 
|  424       UserMetrics::RecordAction(UserMetricsAction("AcceptedKeyword"), profile_); |  424       UserMetrics::RecordAction(UserMetricsAction("AcceptedKeyword"), profile_); | 
|  425       template_url_model->IncrementUsageCount(template_url); |  425       template_url_model->IncrementUsageCount(template_url); | 
|  426     } |  426     } | 
|  427  |  427  | 
|  428     // NOTE: We purposefully don't increment the usage count of the default |  428     // NOTE: We purposefully don't increment the usage count of the default | 
|  429     // search engine, if applicable; see comments in template_url.h. |  429     // search engine, if applicable; see comments in template_url.h. | 
|  430   } |  430   } | 
|  431  |  431  | 
|  432   controller_->OnAutocompleteWillAccept(); |  432   if (disposition != NEW_BACKGROUND_TAB) { | 
|  433  |  433     controller_->OnAutocompleteWillAccept(); | 
|  434   if (disposition != NEW_BACKGROUND_TAB) |  | 
|  435     view_->RevertAll();  // Revert the box to its unedited state |  434     view_->RevertAll();  // Revert the box to its unedited state | 
 |  435   } | 
|  436   controller_->OnAutocompleteAccept(url, disposition, transition, |  436   controller_->OnAutocompleteAccept(url, disposition, transition, | 
|  437                                     alternate_nav_url); |  437                                     alternate_nav_url); | 
|  438 } |  438 } | 
|  439  |  439  | 
|  440 void AutocompleteEditModel::AcceptKeyword() { |  440 void AutocompleteEditModel::AcceptKeyword() { | 
|  441   view_->OnBeforePossibleChange(); |  441   view_->OnBeforePossibleChange(); | 
|  442   view_->SetWindowTextAndCaretPos(std::wstring(), 0); |  442   view_->SetWindowTextAndCaretPos(std::wstring(), 0); | 
|  443   is_keyword_hint_ = false; |  443   is_keyword_hint_ = false; | 
|  444   keyword_ui_state_ = KEYWORD; |  444   keyword_ui_state_ = KEYWORD; | 
|  445   view_->OnAfterPossibleChange(); |  445   view_->OnAfterPossibleChange(); | 
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  836             i->inline_autocomplete_offset != std::wstring::npos) { |  836             i->inline_autocomplete_offset != std::wstring::npos) { | 
|  837           suggested_text = WideToUTF16(i->fill_into_edit.substr( |  837           suggested_text = WideToUTF16(i->fill_into_edit.substr( | 
|  838                                            i->inline_autocomplete_offset)); |  838                                            i->inline_autocomplete_offset)); | 
|  839           break; |  839           break; | 
|  840         } |  840         } | 
|  841       } |  841       } | 
|  842     } |  842     } | 
|  843   } |  843   } | 
|  844   controller_->OnSetSuggestedSearchText(suggested_text); |  844   controller_->OnSetSuggestedSearchText(suggested_text); | 
|  845 } |  845 } | 
| OLD | NEW |