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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 // will have updated our state already, so in that case we don't also return | 1002 // will have updated our state already, so in that case we don't also return |
1003 // true from this function. | 1003 // true from this function. |
1004 return !(text_differs && allow_keyword_ui_change && !just_deleted_text && | 1004 return !(text_differs && allow_keyword_ui_change && !just_deleted_text && |
1005 no_selection && (selection_start == user_text_.length()) && | 1005 no_selection && (selection_start == user_text_.length()) && |
1006 MaybeAcceptKeywordBySpace(user_text_)); | 1006 MaybeAcceptKeywordBySpace(user_text_)); |
1007 } | 1007 } |
1008 | 1008 |
1009 void OmniboxEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) { | 1009 void OmniboxEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) { |
1010 InstantController* instant = controller_->GetInstant(); | 1010 InstantController* instant = controller_->GetInstant(); |
1011 if (instant) | 1011 if (instant) |
| 1012 instant->SetPopupBounds(bounds); |
| 1013 } |
| 1014 |
| 1015 void OmniboxEditModel::OnOmniboxBoundsChanged(const gfx::Rect& bounds) { |
| 1016 InstantController* instant = controller_->GetInstant(); |
| 1017 if (instant) |
1012 instant->SetOmniboxBounds(bounds); | 1018 instant->SetOmniboxBounds(bounds); |
1013 } | 1019 } |
1014 | 1020 |
1015 void OmniboxEditModel::OnResultChanged(bool default_match_changed) { | 1021 void OmniboxEditModel::OnResultChanged(bool default_match_changed) { |
1016 const bool was_open = popup_->IsOpen(); | 1022 const bool was_open = popup_->IsOpen(); |
1017 if (default_match_changed) { | 1023 if (default_match_changed) { |
1018 string16 inline_autocomplete_text; | 1024 string16 inline_autocomplete_text; |
1019 string16 keyword; | 1025 string16 keyword; |
1020 bool is_keyword_hint = false; | 1026 bool is_keyword_hint = false; |
1021 const AutocompleteResult& result = this->result(); | 1027 const AutocompleteResult& result = this->result(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 } | 1294 } |
1289 | 1295 |
1290 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1296 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
1291 const string16& text, | 1297 const string16& text, |
1292 AutocompleteMatch* match, | 1298 AutocompleteMatch* match, |
1293 GURL* alternate_nav_url) const { | 1299 GURL* alternate_nav_url) const { |
1294 DCHECK(match); | 1300 DCHECK(match); |
1295 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1301 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
1296 string16(), false, false, match, alternate_nav_url); | 1302 string16(), false, false, match, alternate_nav_url); |
1297 } | 1303 } |
OLD | NEW |