Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 10274023: Omnibox SearchProvider Experiment Client Implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working to some degree... Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 } 894 }
895 895
896 void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) { 896 void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) {
897 InstantController* instant = controller_->GetInstant(); 897 InstantController* instant = controller_->GetInstant();
898 if (instant) 898 if (instant)
899 instant->SetOmniboxBounds(bounds); 899 instant->SetOmniboxBounds(bounds);
900 } 900 }
901 901
902 void AutocompleteEditModel::OnResultChanged(bool default_match_changed) { 902 void AutocompleteEditModel::OnResultChanged(bool default_match_changed) {
903 const bool was_open = popup_->IsOpen(); 903 const bool was_open = popup_->IsOpen();
904 if (default_match_changed) { 904 // TODO(msw): Run this in all cases, or fixup default_match_changed?
Peter Kasting 2012/05/04 00:11:33 Shouldn't need to touch this, I wouldn't think.
msw 2012/05/04 09:43:40 Reverted.
905 static bool msw = true; if (msw || default_match_changed) {
905 string16 inline_autocomplete_text; 906 string16 inline_autocomplete_text;
906 string16 keyword; 907 string16 keyword;
907 bool is_keyword_hint = false; 908 bool is_keyword_hint = false;
908 const AutocompleteResult& result = this->result(); 909 const AutocompleteResult& result = this->result();
909 const AutocompleteResult::const_iterator match(result.default_match()); 910 const AutocompleteResult::const_iterator match(result.default_match());
910 if (match != result.end()) { 911 if (match != result.end()) {
911 if ((match->inline_autocomplete_offset != string16::npos) && 912 if ((match->inline_autocomplete_offset != string16::npos) &&
912 (match->inline_autocomplete_offset < 913 (match->inline_autocomplete_offset <
913 match->fill_into_edit.length())) { 914 match->fill_into_edit.length())) {
914 inline_autocomplete_text = 915 inline_autocomplete_text =
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 // static 1132 // static
1132 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { 1133 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) {
1133 switch (c) { 1134 switch (c) {
1134 case 0x0020: // Space 1135 case 0x0020: // Space
1135 case 0x3000: // Ideographic Space 1136 case 0x3000: // Ideographic Space
1136 return true; 1137 return true;
1137 default: 1138 default:
1138 return false; 1139 return false;
1139 } 1140 }
1140 } 1141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698