| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 if (accepted_suggestion >= 0) | 332 if (accepted_suggestion >= 0) |
| 333 url.insert(i->index, "oq=" + UTF16ToUTF8(encoded_original_query) + | 333 url.insert(i->index, "oq=" + UTF16ToUTF8(encoded_original_query) + |
| 334 "&"); | 334 "&"); |
| 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) && defined(GOOGLE_CHROME_BUILD) |
| 343 std::wstring rlz_string; | 343 std::wstring rlz_string; |
| 344 RLZTracker::GetAccessPointRlz(rlz_lib::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, WideToUTF8(rlz_string)); | 347 url.insert(i->index, WideToUTF8(rlz_string)); |
| 348 } | 348 } |
| 349 #endif | 349 #endif |
| 350 break; | 350 break; |
| 351 } | 351 } |
| 352 | 352 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } | 620 } |
| 621 | 621 |
| 622 std::string TemplateURL::GetExtensionId() const { | 622 std::string TemplateURL::GetExtensionId() const { |
| 623 DCHECK(IsExtensionKeyword()); | 623 DCHECK(IsExtensionKeyword()); |
| 624 return GURL(url_.url()).host(); | 624 return GURL(url_.url()).host(); |
| 625 } | 625 } |
| 626 | 626 |
| 627 bool TemplateURL::IsExtensionKeyword() const { | 627 bool TemplateURL::IsExtensionKeyword() const { |
| 628 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); | 628 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); |
| 629 } | 629 } |
| OLD | NEW |