summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-20 22:07:32 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-20 22:07:32 +0000
commit731f8a457d14ed49c2aed56fd5a59d1719837171 (patch)
tree3cfaaccd4e666fb455df028a7e856ebebef4e95d /chrome
parent772836b19450e8e15ac98e6f783af0fc1a2fb8e3 (diff)
downloadchromium_src-731f8a457d14ed49c2aed56fd5a59d1719837171.zip
chromium_src-731f8a457d14ed49c2aed56fd5a59d1719837171.tar.gz
chromium_src-731f8a457d14ed49c2aed56fd5a59d1719837171.tar.bz2
Fix misleading name and comment of Browser::GetCurrentPageTitle.
GetWindowTitleForCurrentTab more accurately describes what this function really does. TEST=none http://crbug.com/16231 Review URL: http://codereview.chromium.org/155534 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser.cc6
-rw-r--r--chrome/browser/browser.h4
-rw-r--r--chrome/browser/browser_browsertest.cc4
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm2
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc2
-rw-r--r--chrome/browser/views/frame/browser_view.cc2
-rw-r--r--chrome/browser/views/panel_controller.cc4
7 files changed, 12 insertions, 12 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index d20cd3f..8567bd0 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -431,12 +431,12 @@ SkBitmap Browser::GetCurrentPageIcon() const {
return contents ? contents->GetFavIcon() : SkBitmap();
}
-string16 Browser::GetCurrentPageTitle() const {
+string16 Browser::GetWindowTitleForCurrentTab() const {
TabContents* contents = tabstrip_model_.GetSelectedTabContents();
string16 title;
- // |contents| can be NULL because GetCurrentPageTitle is called by the window
- // during the window's creation (before tabs have been added).
+ // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the
+ // window during the window's creation (before tabs have been added).
if (contents) {
title = contents->GetTitle();
FormatTitleForDisplay(&title);
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 98464b3..2dd56b1 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -162,8 +162,8 @@ class Browser : public TabStripModelDelegate,
// Gets the FavIcon of the page in the selected tab.
SkBitmap GetCurrentPageIcon() const;
- // Gets the title of the page in the selected tab.
- string16 GetCurrentPageTitle() const;
+ // Gets the title of the window based on the selected tab's title.
+ string16 GetWindowTitleForCurrentTab() const;
// Prepares a title string for display (removes embedded newlines, etc).
static void FormatTitleForDisplay(string16* title);
diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc
index e1302ac..0826527 100644
--- a/chrome/browser/browser_browsertest.cc
+++ b/chrome/browser/browser_browsertest.cc
@@ -65,7 +65,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NoTitle) {
ui_test_utils::NavigateToURL(browser(),
ui_test_utils::GetTestUrl(L".", L"title1.html"));
EXPECT_EQ(LocaleWindowCaptionFromPageTitle(L"title1.html"),
- UTF16ToWideHack(browser()->GetCurrentPageTitle()));
+ UTF16ToWideHack(browser()->GetWindowTitleForCurrentTab()));
string16 tab_title;
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title));
EXPECT_EQ(ASCIIToUTF16("title1.html"), tab_title);
@@ -78,7 +78,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, Title) {
ui_test_utils::GetTestUrl(L".", L"title2.html"));
const std::wstring test_title(L"Title Of Awesomeness");
EXPECT_EQ(LocaleWindowCaptionFromPageTitle(test_title),
- UTF16ToWideHack(browser()->GetCurrentPageTitle()));
+ UTF16ToWideHack(browser()->GetWindowTitleForCurrentTab()));
string16 tab_title;
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &tab_title));
EXPECT_EQ(WideToUTF16(test_title), tab_title);
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index 7e72184..d9846253 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -92,7 +92,7 @@ void BrowserWindowCocoa::SelectedTabToolbarSizeChanged(bool is_animating) {
void BrowserWindowCocoa::UpdateTitleBar() {
NSString* newTitle =
- base::SysUTF16ToNSString(browser_->GetCurrentPageTitle());
+ base::SysUTF16ToNSString(browser_->GetWindowTitleForCurrentTab());
// Window menu
[NSApp changeWindowsItem:window_ title:newTitle filename:NO];
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 1eaaeaf..913b4ec 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -585,7 +585,7 @@ void BrowserWindowGtk::UpdateTitleBar() {
panel_controller_->UpdateTitleBar();
#endif
- string16 title = browser_->GetCurrentPageTitle();
+ string16 title = browser_->GetWindowTitleForCurrentTab();
gtk_window_set_title(window_, UTF16ToUTF8(title).c_str());
if (ShouldShowWindowIcon()) {
// TODO(tc): If we're showing a title bar, we should update the app icon.
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 579d18b..15f2795 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -1127,7 +1127,7 @@ bool BrowserView::IsModal() const {
}
std::wstring BrowserView::GetWindowTitle() const {
- return UTF16ToWideHack(browser_->GetCurrentPageTitle());
+ return UTF16ToWideHack(browser_->GetWindowTitleForCurrentTab());
}
views::View* BrowserView::GetInitiallyFocusedView() {
diff --git a/chrome/browser/views/panel_controller.cc b/chrome/browser/views/panel_controller.cc
index 171a8f0..102d018 100644
--- a/chrome/browser/views/panel_controller.cc
+++ b/chrome/browser/views/panel_controller.cc
@@ -95,8 +95,8 @@ PanelController::PanelController(BrowserWindowGtk* browser_window)
}
void PanelController::UpdateTitleBar() {
- title_content_->title_label()->SetText(
- UTF16ToWideHack(browser_window_->browser()->GetCurrentPageTitle()));
+ title_content_->title_label()->SetText(UTF16ToWideHack(
+ browser_window_->browser()->GetWindowTitleForCurrentTab()));
}
bool PanelController::TitleMousePressed(const views::MouseEvent& event) {