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

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

Issue 11820015: Revert 175099 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/history_quick_provider.h" 5 #include "chrome/browser/autocomplete/history_quick_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 inlining_option, NUM_OPTIONS); 111 inlining_option, NUM_OPTIONS);
112 112
113 reorder_for_inlining_ = CommandLine::ForCurrentProcess()-> 113 reorder_for_inlining_ = CommandLine::ForCurrentProcess()->
114 GetSwitchValueASCII(switches:: 114 GetSwitchValueASCII(switches::
115 kOmniboxHistoryQuickProviderReorderForInlining) == 115 kOmniboxHistoryQuickProviderReorderForInlining) ==
116 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled; 116 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled;
117 } 117 }
118 118
119 void HistoryQuickProvider::Start(const AutocompleteInput& input, 119 void HistoryQuickProvider::Start(const AutocompleteInput& input,
120 bool minimal_changes) { 120 bool minimal_changes) {
121 if (minimal_changes)
122 return;
123 matches_.clear(); 121 matches_.clear();
124 if (disabled_) 122 if (disabled_)
125 return; 123 return;
126 124
127 // Don't bother with INVALID and FORCED_QUERY. Also pass when looking for 125 // Don't bother with INVALID and FORCED_QUERY. Also pass when looking for
128 // BEST_MATCH and there is no inline autocompletion because none of the HQP 126 // BEST_MATCH and there is no inline autocompletion because none of the HQP
129 // matches can score highly enough to qualify. 127 // matches can score highly enough to qualify.
130 if ((input.type() == AutocompleteInput::INVALID) || 128 if ((input.type() == AutocompleteInput::INVALID) ||
131 (input.type() == AutocompleteInput::FORCED_QUERY) || 129 (input.type() == AutocompleteInput::FORCED_QUERY) ||
132 (input.matches_requested() == AutocompleteInput::BEST_MATCH && 130 (input.matches_requested() == AutocompleteInput::BEST_MATCH &&
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 do { 390 do {
393 offset += matches[i].length; 391 offset += matches[i].length;
394 ++i; 392 ++i;
395 } while ((i < match_count) && (offset == matches[i].offset)); 393 } while ((i < match_count) && (offset == matches[i].offset));
396 if (offset < text_length) 394 if (offset < text_length)
397 spans.push_back(ACMatchClassification(offset, url_style)); 395 spans.push_back(ACMatchClassification(offset, url_style));
398 } 396 }
399 397
400 return spans; 398 return spans;
401 } 399 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698