| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 usage_count_(0), | 571 usage_count_(0), |
| 572 search_engine_type_(SEARCH_ENGINE_OTHER), | 572 search_engine_type_(SEARCH_ENGINE_OTHER), |
| 573 logo_id_(kNoSearchEngineLogo), | 573 logo_id_(kNoSearchEngineLogo), |
| 574 prepopulate_id_(0) { | 574 prepopulate_id_(0) { |
| 575 } | 575 } |
| 576 | 576 |
| 577 TemplateURL::~TemplateURL() { | 577 TemplateURL::~TemplateURL() { |
| 578 } | 578 } |
| 579 | 579 |
| 580 std::wstring TemplateURL::AdjustedShortNameForLocaleDirection() const { | 580 std::wstring TemplateURL::AdjustedShortNameForLocaleDirection() const { |
| 581 std::wstring bidi_safe_short_name; | 581 std::wstring bidi_safe_short_name = short_name_; |
| 582 if (base::i18n::AdjustStringForLocaleDirection(short_name_, | 582 base::i18n::AdjustStringForLocaleDirection(&bidi_safe_short_name); |
| 583 &bidi_safe_short_name)) | 583 return bidi_safe_short_name; |
| 584 return bidi_safe_short_name; | |
| 585 return short_name_; | |
| 586 } | 584 } |
| 587 | 585 |
| 588 void TemplateURL::SetSuggestionsURL(const std::string& suggestions_url, | 586 void TemplateURL::SetSuggestionsURL(const std::string& suggestions_url, |
| 589 int index_offset, | 587 int index_offset, |
| 590 int page_offset) { | 588 int page_offset) { |
| 591 suggestions_url_.Set(suggestions_url, index_offset, page_offset); | 589 suggestions_url_.Set(suggestions_url, index_offset, page_offset); |
| 592 } | 590 } |
| 593 | 591 |
| 594 void TemplateURL::SetURL(const std::string& url, | 592 void TemplateURL::SetURL(const std::string& url, |
| 595 int index_offset, | 593 int index_offset, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 } | 667 } |
| 670 | 668 |
| 671 std::string TemplateURL::GetExtensionId() const { | 669 std::string TemplateURL::GetExtensionId() const { |
| 672 DCHECK(IsExtensionKeyword()); | 670 DCHECK(IsExtensionKeyword()); |
| 673 return GURL(url_.url()).host(); | 671 return GURL(url_.url()).host(); |
| 674 } | 672 } |
| 675 | 673 |
| 676 bool TemplateURL::IsExtensionKeyword() const { | 674 bool TemplateURL::IsExtensionKeyword() const { |
| 677 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); | 675 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); |
| 678 } | 676 } |
| OLD | NEW |