OLD | NEW |
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/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 std::string host = stripped_destination_url.host(); | 371 std::string host = stripped_destination_url.host(); |
372 if (host.compare(0, prefix_len, prefix) == 0) { | 372 if (host.compare(0, prefix_len, prefix) == 0) { |
373 host = host.substr(prefix_len); | 373 host = host.substr(prefix_len); |
374 replacements.SetHostStr(host); | 374 replacements.SetHostStr(host); |
375 needs_replacement = true; | 375 needs_replacement = true; |
376 } | 376 } |
377 | 377 |
378 // Replace https protocol with http protocol. | 378 // Replace https protocol with http protocol. |
379 if (stripped_destination_url.SchemeIs(content::kHttpsScheme)) { | 379 if (stripped_destination_url.SchemeIs(content::kHttpsScheme)) { |
380 replacements.SetScheme( | 380 replacements.SetScheme( |
381 chrome::kHttpScheme, | 381 content::kHttpScheme, |
382 url_parse::Component(0, strlen(chrome::kHttpScheme))); | 382 url_parse::Component(0, strlen(content::kHttpScheme))); |
383 needs_replacement = true; | 383 needs_replacement = true; |
384 } | 384 } |
385 | 385 |
386 if (needs_replacement) | 386 if (needs_replacement) |
387 stripped_destination_url = stripped_destination_url.ReplaceComponents( | 387 stripped_destination_url = stripped_destination_url.ReplaceComponents( |
388 replacements); | 388 replacements); |
389 } | 389 } |
390 | 390 |
391 void AutocompleteMatch::GetKeywordUIState(Profile* profile, | 391 void AutocompleteMatch::GetKeywordUIState(Profile* profile, |
392 string16* keyword, | 392 string16* keyword, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 << " is unsorted in relation to last offset of " << last_offset | 485 << " is unsorted in relation to last offset of " << last_offset |
486 << ". Provider: " << provider_name << "."; | 486 << ". Provider: " << provider_name << "."; |
487 DCHECK_LT(i->offset, text.length()) | 487 DCHECK_LT(i->offset, text.length()) |
488 << " Classification of [" << i->offset << "," << text.length() | 488 << " Classification of [" << i->offset << "," << text.length() |
489 << "] is out of bounds for \"" << text << "\". Provider: " | 489 << "] is out of bounds for \"" << text << "\". Provider: " |
490 << provider_name << "."; | 490 << provider_name << "."; |
491 last_offset = i->offset; | 491 last_offset = i->offset; |
492 } | 492 } |
493 } | 493 } |
494 #endif | 494 #endif |
OLD | NEW |