diff options
Diffstat (limited to 'chrome/browser/location_bar_util.cc')
-rw-r--r-- | chrome/browser/location_bar_util.cc | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/chrome/browser/location_bar_util.cc b/chrome/browser/location_bar_util.cc deleted file mode 100644 index a398ada..0000000 --- a/chrome/browser/location_bar_util.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/location_bar_util.h" - -#include "app/l10n_util.h" -#include "base/i18n/rtl.h" -#include "chrome/browser/profile.h" -#include "chrome/browser/search_engines/template_url.h" -#include "chrome/browser/search_engines/template_url_model.h" - -namespace location_bar_util { - -std::wstring GetKeywordName(Profile* profile, const std::wstring& keyword) { -// Make sure the TemplateURL still exists. -// TODO(sky): Once LocationBarView adds a listener to the TemplateURLModel -// to track changes to the model, this should become a DCHECK. - const TemplateURL* template_url = - profile->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword); - if (template_url) - return template_url->AdjustedShortNameForLocaleDirection(); - return std::wstring(); -} - -std::wstring CalculateMinString(const std::wstring& description) { - // Chop at the first '.' or whitespace. - const size_t dot_index = description.find(L'.'); - const size_t ws_index = description.find_first_of(kWhitespaceWide); - size_t chop_index = std::min(dot_index, ws_index); - std::wstring min_string; - if (chop_index == std::wstring::npos) { - // No dot or whitespace, truncate to at most 3 chars. - min_string = l10n_util::TruncateString(description, 3); - } else { - min_string = description.substr(0, chop_index); - } - base::i18n::AdjustStringForLocaleDirection(&min_string); - return min_string; -} - -} // namespace location_bar_util |