summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 23:16:29 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 23:16:29 +0000
commit4973efc5711e1ab70c68221eb47c7ef7151a623a (patch)
tree8fad642b4570d7d0f18b9fd11656e4d5e3a4fbbc /chrome
parentfacd7a7651cf81da7fbe48596be7f4324ff86ab8 (diff)
downloadchromium_src-4973efc5711e1ab70c68221eb47c7ef7151a623a.zip
chromium_src-4973efc5711e1ab70c68221eb47c7ef7151a623a.tar.gz
chromium_src-4973efc5711e1ab70c68221eb47c7ef7151a623a.tar.bz2
Completely miscellaneous minor cleanup. Remove some unneeded class declarations, modify or add a couple comments, change a function name in hopes of greater accuracy.
Review URL: http://codereview.chromium.org/119264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc7
-rw-r--r--chrome/browser/browser_window.h4
-rw-r--r--chrome/browser/search_engines/template_url.h2
-rw-r--r--chrome/browser/views/location_bar_view.cc14
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()));