| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/search_engines/template_url.h" | 5 #include "chrome/browser/search_engines/template_url.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 UTF16ToWideHack(encoded_original_query) + L"&"); | 334 UTF16ToWideHack(encoded_original_query) + L"&"); |
| 335 break; | 335 break; |
| 336 | 336 |
| 337 case GOOGLE_RLZ: { | 337 case GOOGLE_RLZ: { |
| 338 // On platforms that don't have RLZ, we still want this branch | 338 // On platforms that don't have RLZ, we still want this branch |
| 339 // to happen so that we replace the RLZ template with the | 339 // to happen so that we replace the RLZ template with the |
| 340 // empty string. (If we don't handle this case, we hit a | 340 // empty string. (If we don't handle this case, we hit a |
| 341 // NOTREACHED below.) | 341 // NOTREACHED below.) |
| 342 #if defined(OS_WIN) | 342 #if defined(OS_WIN) |
| 343 std::wstring rlz_string; | 343 std::wstring rlz_string; |
| 344 RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz_string); | 344 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); |
| 345 if (!rlz_string.empty()) { | 345 if (!rlz_string.empty()) { |
| 346 rlz_string = L"rlz=" + rlz_string + L"&"; | 346 rlz_string = L"rlz=" + rlz_string + L"&"; |
| 347 url.insert(i->index, rlz_string); | 347 url.insert(i->index, rlz_string); |
| 348 } | 348 } |
| 349 #endif | 349 #endif |
| 350 break; | 350 break; |
| 351 } | 351 } |
| 352 | 352 |
| 353 case GOOGLE_UNESCAPED_SEARCH_TERMS: { | 353 case GOOGLE_UNESCAPED_SEARCH_TERMS: { |
| 354 std::string unescaped_terms; | 354 std::string unescaped_terms; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 } | 624 } |
| 625 | 625 |
| 626 std::string TemplateURL::GetExtensionId() const { | 626 std::string TemplateURL::GetExtensionId() const { |
| 627 DCHECK(IsExtensionKeyword()); | 627 DCHECK(IsExtensionKeyword()); |
| 628 return GURL(WideToUTF8(url_.url())).host(); | 628 return GURL(WideToUTF8(url_.url())).host(); |
| 629 } | 629 } |
| 630 | 630 |
| 631 bool TemplateURL::IsExtensionKeyword() const { | 631 bool TemplateURL::IsExtensionKeyword() const { |
| 632 return GURL(WideToUTF8(url_.url())).SchemeIs(chrome::kExtensionScheme); | 632 return GURL(WideToUTF8(url_.url())).SchemeIs(chrome::kExtensionScheme); |
| 633 } | 633 } |
| OLD | NEW |