summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 00:38:19 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 00:38:19 +0000
commitb519281d42b82e787e4ba0cb31f3d6cc91c954d3 (patch)
treefb077507c27d1b35b46e14ae99cd5edfe1195e20 /chrome/browser/browser.cc
parent3cde1db6f69ce6c03e752cc86bbadf9379259fb2 (diff)
downloadchromium_src-b519281d42b82e787e4ba0cb31f3d6cc91c954d3.zip
chromium_src-b519281d42b82e787e4ba0cb31f3d6cc91c954d3.tar.gz
chromium_src-b519281d42b82e787e4ba0cb31f3d6cc91c954d3.tar.bz2
Even more tweaks.
- make window icon and title work on app windows - make window title updating sync with the task bar - make Aero Glass frame respect app mode settings - move title formatting routine from TabRenderer into Browser (a more central location) - appearance adjustments for app windows with info bars git-svn-id: svn://svn.chromium.org/chrome/trunk/src@612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 105654f..866b2a5 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1632,7 +1632,7 @@ void Browser::OpenURLOffTheRecord(Profile* profile, const GURL& url) {
std::wstring Browser::ComputePopupTitle(const GURL& url,
const std::wstring& title) {
std::wstring result(title);
- Tab::FormatTitleForDisplay(&result);
+ FormatTitleForDisplay(&result);
return result;
}
@@ -1762,3 +1762,35 @@ NavigationController* Browser::GetSelectedNavigationController() const {
else
return NULL;
}
+
+///////////////////////////////////////////////////////////////////////////////
+// NEW FRAME TODO(beng): clean up this file
+// DO NOT PLACE METHODS NOT RELATED TO NEW FRAMES BELOW THIS LINE.
+
+SkBitmap Browser::GetCurrentPageIcon() const {
+ TabContents* contents = tabstrip_model_.GetSelectedTabContents();
+ return contents ? contents->GetFavIcon() : SkBitmap();
+}
+
+std::wstring Browser::GetCurrentPageTitle() const {
+ TabContents* contents = tabstrip_model_.GetSelectedTabContents();
+ std::wstring title;
+ if (contents) {
+ title = contents->GetTitle();
+ FormatTitleForDisplay(&title);
+ }
+ if (title.empty())
+ title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE);
+ return title;
+}
+
+// static
+void Browser::FormatTitleForDisplay(std::wstring* title) {
+ size_t current_index = 0;
+ size_t match_index;
+ while ((match_index = title->find(L'\n', current_index)) !=
+ std::wstring::npos) {
+ title->replace(match_index, 1, L"");
+ current_index = match_index;
+ }
+}