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

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

Issue 11722020: Omnibox: Make HistoryQuick provider not re-issue queries if |minimal_changes| is true (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;
121 matches_.clear(); 123 matches_.clear();
122 if (disabled_) 124 if (disabled_)
123 return; 125 return;
124 126
125 // Don't bother with INVALID and FORCED_QUERY. Also pass when looking for 127 // Don't bother with INVALID and FORCED_QUERY. Also pass when looking for
126 // BEST_MATCH and there is no inline autocompletion because none of the HQP 128 // BEST_MATCH and there is no inline autocompletion because none of the HQP
127 // matches can score highly enough to qualify. 129 // matches can score highly enough to qualify.
128 if ((input.type() == AutocompleteInput::INVALID) || 130 if ((input.type() == AutocompleteInput::INVALID) ||
129 (input.type() == AutocompleteInput::FORCED_QUERY) || 131 (input.type() == AutocompleteInput::FORCED_QUERY) ||
130 (input.matches_requested() == AutocompleteInput::BEST_MATCH && 132 (input.matches_requested() == AutocompleteInput::BEST_MATCH &&
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 do { 392 do {
391 offset += matches[i].length; 393 offset += matches[i].length;
392 ++i; 394 ++i;
393 } while ((i < match_count) && (offset == matches[i].offset)); 395 } while ((i < match_count) && (offset == matches[i].offset));
394 if (offset < text_length) 396 if (offset < text_length)
395 spans.push_back(ACMatchClassification(offset, url_style)); 397 spans.push_back(ACMatchClassification(offset, url_style));
396 } 398 }
397 399
398 return spans; 400 return spans;
399 } 401 }
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