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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apitest.js Created 7 years, 10 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_match.h" 5 #include "chrome/browser/autocomplete/autocomplete_match.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 DCHECK(classifications); 335 DCHECK(classifications);
336 if (classifications->empty() || classifications->back().style != style) { 336 if (classifications->empty() || classifications->back().style != style) {
337 DCHECK(classifications->empty() || 337 DCHECK(classifications->empty() ||
338 (offset > classifications->back().offset)); 338 (offset > classifications->back().offset));
339 classifications->push_back(ACMatchClassification(offset, style)); 339 classifications->push_back(ACMatchClassification(offset, style));
340 } 340 }
341 } 341 }
342 342
343 // static 343 // static
344 string16 AutocompleteMatch::SanitizeString(const string16& text) { 344 string16 AutocompleteMatch::SanitizeString(const string16& text) {
345 // NOTE: This logic is mirrored by |sanitizeString()| in 345 // NOTE: This logic is mirrored by |sanitizeString()| in bindings.js.
not at google - send to devlin 2013/02/13 01:45:49 it's actually in omnibox_custom_bindings.js.
cduvall 2013/02/15 00:40:28 Done.
346 // schema_generated_bindings.js.
347 string16 result; 346 string16 result;
348 TrimWhitespace(text, TRIM_LEADING, &result); 347 TrimWhitespace(text, TRIM_LEADING, &result);
349 RemoveChars(result, kInvalidChars, &result); 348 RemoveChars(result, kInvalidChars, &result);
350 return result; 349 return result;
351 } 350 }
352 351
353 // static 352 // static
354 bool AutocompleteMatch::IsSearchType(Type type) { 353 bool AutocompleteMatch::IsSearchType(Type type) {
355 return type == SEARCH_WHAT_YOU_TYPED || 354 return type == SEARCH_WHAT_YOU_TYPED ||
356 type == SEARCH_HISTORY || 355 type == SEARCH_HISTORY ||
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 << " is unsorted in relation to last offset of " << last_offset 489 << " is unsorted in relation to last offset of " << last_offset
491 << ". Provider: " << provider_name << "."; 490 << ". Provider: " << provider_name << ".";
492 DCHECK_LT(i->offset, text.length()) 491 DCHECK_LT(i->offset, text.length())
493 << " Classification of [" << i->offset << "," << text.length() 492 << " Classification of [" << i->offset << "," << text.length()
494 << "] is out of bounds for \"" << text << "\". Provider: " 493 << "] is out of bounds for \"" << text << "\". Provider: "
495 << provider_name << "."; 494 << provider_name << ".";
496 last_offset = i->offset; 495 last_offset = i->offset;
497 } 496 }
498 } 497 }
499 #endif 498 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | chrome/common/extensions/api/extension_api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698