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

Side by Side Diff: components/omnibox/history_provider.cc

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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 "components/omnibox/history_provider.h" 5 #include "components/omnibox/history_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 21 matching lines...) Expand all
32 history_service->DeleteURL(match.destination_url); 32 history_service->DeleteURL(match.destination_url);
33 33
34 DeleteMatchFromMatches(match); 34 DeleteMatchFromMatches(match);
35 } 35 }
36 36
37 // static 37 // static
38 bool HistoryProvider::PreventInlineAutocomplete( 38 bool HistoryProvider::PreventInlineAutocomplete(
39 const AutocompleteInput& input) { 39 const AutocompleteInput& input) {
40 return input.prevent_inline_autocomplete() || 40 return input.prevent_inline_autocomplete() ||
41 (!input.text().empty() && 41 (!input.text().empty() &&
42 IsWhitespace(input.text()[input.text().length() - 1])); 42 base::IsUnicodeWhitespace(input.text()[input.text().length() - 1]));
43 } 43 }
44 44
45 HistoryProvider::HistoryProvider(AutocompleteProvider::Type type, 45 HistoryProvider::HistoryProvider(AutocompleteProvider::Type type,
46 AutocompleteProviderClient* client) 46 AutocompleteProviderClient* client)
47 : AutocompleteProvider(type), client_(client) { 47 : AutocompleteProvider(type), client_(client) {
48 } 48 }
49 49
50 HistoryProvider::~HistoryProvider() {} 50 HistoryProvider::~HistoryProvider() {}
51 51
52 void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) { 52 void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 do { 96 do {
97 offset += matches[i].length; 97 offset += matches[i].length;
98 ++i; 98 ++i;
99 } while ((i < match_count) && (offset == matches[i].offset)); 99 } while ((i < match_count) && (offset == matches[i].offset));
100 if (offset < text_length) 100 if (offset < text_length)
101 spans.push_back(ACMatchClassification(offset, url_style)); 101 spans.push_back(ACMatchClassification(offset, url_style));
102 } 102 }
103 103
104 return spans; 104 return spans;
105 } 105 }
OLDNEW
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_driver_unittest.cc ('k') | components/omnibox/scored_history_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698