OLD | NEW |
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 <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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 709 |
710 const AutocompleteResult& OmniboxEditModel::result() const { | 710 const AutocompleteResult& OmniboxEditModel::result() const { |
711 return autocomplete_controller_->result(); | 711 return autocomplete_controller_->result(); |
712 } | 712 } |
713 | 713 |
714 void OmniboxEditModel::OnSetFocus(bool control_down) { | 714 void OmniboxEditModel::OnSetFocus(bool control_down) { |
715 has_focus_ = true; | 715 has_focus_ = true; |
716 control_key_state_ = control_down ? DOWN_WITHOUT_CHANGE : UP; | 716 control_key_state_ = control_down ? DOWN_WITHOUT_CHANGE : UP; |
717 | 717 |
718 if (InstantController* instant = controller_->GetInstant()) | 718 if (InstantController* instant = controller_->GetInstant()) |
719 instant->OmniboxGotFocus(); | 719 instant->OmniboxGotFocus(true /* focus_is_visible */); |
720 | 720 |
721 content::WebContents* web_contents = controller_->GetWebContents(); | 721 content::WebContents* web_contents = controller_->GetWebContents(); |
722 if (web_contents) { | 722 if (web_contents) { |
723 // TODO(jered): We may want to merge this into Start() and just call that | 723 // TODO(jered): We may want to merge this into Start() and just call that |
724 // here rather than having a special entry point for zero-suggest. Note | 724 // here rather than having a special entry point for zero-suggest. Note |
725 // that we avoid PermanentURL() here because it's not guaranteed to give us | 725 // that we avoid PermanentURL() here because it's not guaranteed to give us |
726 // the actual underlying current URL, e.g. if we're on the NTP and the | 726 // the actual underlying current URL, e.g. if we're on the NTP and the |
727 // |permanent_text_| is empty. | 727 // |permanent_text_| is empty. |
728 autocomplete_controller_->StartZeroSuggest(web_contents->GetURL(), | 728 autocomplete_controller_->StartZeroSuggest(web_contents->GetURL(), |
729 user_text_); | 729 user_text_); |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 } | 1271 } |
1272 | 1272 |
1273 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1273 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
1274 const string16& text, | 1274 const string16& text, |
1275 AutocompleteMatch* match, | 1275 AutocompleteMatch* match, |
1276 GURL* alternate_nav_url) const { | 1276 GURL* alternate_nav_url) const { |
1277 DCHECK(match); | 1277 DCHECK(match); |
1278 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1278 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
1279 string16(), false, false, match, alternate_nav_url); | 1279 string16(), false, false, match, alternate_nav_url); |
1280 } | 1280 } |
OLD | NEW |