diff options
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit.cc | 7 | ||||
-rw-r--r-- | chrome/browser/browser_window.h | 4 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 14 |
4 files changed, 12 insertions, 15 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc index 70622d3..b842884 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -198,11 +198,10 @@ bool AutocompleteEditModel::CanPasteAndGo(const std::wstring& text) const { paste_and_go_alternate_nav_url_ = GURL(); // Ask the controller what do do with this input. + // Setting the profile is cheap, and since there's one paste_and_go_controller + // for many tabs which may all have different profiles, it ensures we're + // always using the right one. paste_and_go_controller->SetProfile(profile_); - // This is cheap, and since there's one - // paste_and_go_controller for many tabs which - // may all have different profiles, it ensures - // we're always using the right one. paste_and_go_controller->Start(text, std::wstring(), true, false, true); DCHECK(paste_and_go_controller->done()); const AutocompleteResult& result = paste_and_go_controller->result(); diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index 743cc94..d0f7d8b 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -8,20 +8,16 @@ #include "base/gfx/native_widget_types.h" class Browser; -class BrowserList; class BrowserWindowTesting; -class DownloadItem; class DownloadShelf; class FindBar; class GURL; class LocationBar; class HtmlDialogUIDelegate; -class Profile; class StatusBubble; class TabContents; namespace gfx { -class Point; class Rect; } diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h index e6f2b65..d59a420 100644 --- a/chrome/browser/search_engines/template_url.h +++ b/chrome/browser/search_engines/template_url.h @@ -272,6 +272,8 @@ class TemplateURL { } const std::wstring& short_name() const { return short_name_; } + // An accessor for the short_name, but adjusted so it can be appropriately + // displayed even if it is LTR and the UI is RTL. std::wstring AdjustedShortNameForLocaleDirection() const; // A description of the template; this may be empty. diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index d41d254..353dd86 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -86,9 +86,9 @@ static const int kInfoBubbleHoverDelayMs = 500; // The tab key image. static const SkBitmap* kTabButtonBitmap = NULL; -// Returns the description for a keyword. -static std::wstring GetKeywordDescription(Profile* profile, - const std::wstring& keyword) { +// Returns the short name for a keyword. +static 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. @@ -769,10 +769,10 @@ void LocationBarView::SelectedKeywordView::SetKeyword( if (!profile_->GetTemplateURLModel()) return; - const std::wstring description = GetKeywordDescription(profile_, keyword); + const std::wstring short_name = GetKeywordName(profile_, keyword); full_label_.SetText(l10n_util::GetStringF(IDS_OMNIBOX_KEYWORD_TEXT, - description)); - const std::wstring min_string = CalculateMinString(description); + short_name)); + const std::wstring min_string = CalculateMinString(short_name); if (!min_string.empty()) { partial_label_.SetText( l10n_util::GetStringF(IDS_OMNIBOX_KEYWORD_TEXT, min_string)); @@ -842,7 +842,7 @@ void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) { std::vector<size_t> content_param_offsets; const std::wstring keyword_hint(l10n_util::GetStringF( IDS_OMNIBOX_KEYWORD_HINT, std::wstring(), - GetKeywordDescription(profile_, keyword), &content_param_offsets)); + GetKeywordName(profile_, keyword), &content_param_offsets)); if (content_param_offsets.size() == 2) { leading_label_.SetText(keyword_hint.substr(0, content_param_offsets.front())); |