summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:46:17 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:46:17 +0000
commitedb5e6a4abf27e5db7638409d7d7566ca024fa90 (patch)
treebad75decbd017cbb1fd7e6d9196e17b89536205b
parent8afd0ad9907d3bab3689fe510881a8da9fa6a5ee (diff)
downloadchromium_src-edb5e6a4abf27e5db7638409d7d7566ca024fa90.zip
chromium_src-edb5e6a4abf27e5db7638409d7d7566ca024fa90.tar.gz
chromium_src-edb5e6a4abf27e5db7638409d7d7566ca024fa90.tar.bz2
Distributor logo and " - App Name" shouldn't be shown on app frame windows.
http://crbug.com/6138 Review URL: http://codereview.chromium.org/62167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13393 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chromium_strings.grd3
-rw-r--r--chrome/app/google_chrome_strings.grd3
-rw-r--r--chrome/browser/browser.cc11
-rw-r--r--chrome/browser/browser.h3
-rw-r--r--chrome/browser/views/frame/browser_view.h6
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.cc5
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.cc5
7 files changed, 31 insertions, 5 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 53f053f..bb3b4ce 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -148,6 +148,9 @@ be available for now. -->
<message name="IDS_BROWSER_WINDOW_TITLE_FORMAT" desc="The format for titles displayed in tabs and popup windows">
<ph name="PAGE_TITLE">$1<ex>Google</ex></ph> - Chromium
</message>
+ <message name="IDS_BROWSER_WINDOW_TITLE_FORMAT_NO_LOGO" desc="The format for titles displayed when the window has no distributor logo displayed">
+ <ph name="PAGE_TITLE">$1<ex>Google</ex></ph>
+ </message>
<message name="IDS_ABOUT_VERSION_COMPANY_NAME" desc="Company name on the about pages">
The Chromium Authors
</message>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index 6d76021..6b49c85 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -196,6 +196,9 @@ Chrome supports. -->
<message name="IDS_BROWSER_WINDOW_TITLE_FORMAT" desc="The format for titles displayed in tabs and popup windows">
<ph name="PAGE_TITLE">$1<ex>Google</ex></ph> - Google Chrome
</message>
+ <message name="IDS_BROWSER_WINDOW_TITLE_FORMAT_NO_LOGO" desc="The format for titles displayed when the window has no distributor logo displayed">
+ <ph name="PAGE_TITLE">$1<ex>Google</ex></ph>
+ </message>
<message name="IDS_ABOUT_VERSION_COMPANY_NAME" desc="Company name on the about pages">
Google Inc.
</message>
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index b9ae5ca..3923936 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -414,7 +414,12 @@ std::wstring Browser::GetCurrentPageTitle() const {
if (title.empty())
title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE);
- return l10n_util::GetStringF(IDS_BROWSER_WINDOW_TITLE_FORMAT, title);
+ int string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT;
+ // Don't append the app name to window titles when we're not displaying a
+ // distributor logo for the frame.
+ if (!ShouldShowDistributorLogo())
+ string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT_NO_LOGO;
+ return l10n_util::GetStringF(string_id, title);
}
// static
@@ -428,6 +433,10 @@ void Browser::FormatTitleForDisplay(std::wstring* title) {
}
}
+bool Browser::ShouldShowDistributorLogo() const {
+ // Don't show the distributor logo on app frames and app popups.
+ return !(type_ & TYPE_APP);
+}
///////////////////////////////////////////////////////////////////////////////
// Browser, OnBeforeUnload handling:
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 970886d..42f76e4 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -173,6 +173,9 @@ class Browser : public TabStripModelDelegate,
// Prepares a title string for display (removes embedded newlines, etc).
static void FormatTitleForDisplay(std::wstring* title);
+ // Returns true if the frame should show a distributor logo for this Browser.
+ bool ShouldShowDistributorLogo() const;
+
// OnBeforeUnload handling //////////////////////////////////////////////////
// Gives beforeunload handlers the chance to cancel the close.
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index c7f0c33..f95c0fa 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -158,6 +158,12 @@ class BrowserView : public BrowserWindow,
return browser_->type() == Browser::TYPE_NORMAL;
}
+ // Returns true if the frame containing this BrowserView should show the
+ // distributor logo.
+ bool ShouldShowDistributorLogo() const {
+ return browser_->ShouldShowDistributorLogo();
+ }
+
// Register preferences specific to this view.
static void RegisterBrowserViewPrefs(PrefService* prefs);
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index 1b736cf..d170a72 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -260,7 +260,8 @@ int GlassBrowserFrameView::NonClientTopBorderHeight() const {
void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
- if (!frame_->IsMaximized() && distributor_logo_) {
+ if (!frame_->IsMaximized() && distributor_logo_ &&
+ browser_view_->ShouldShowDistributorLogo()) {
// NOTE: We don't mirror the logo placement here because the outer frame
// itself isn't mirrored in RTL. This is a bug; if it is fixed, this should
// be mirrored as in opaque_non_client_view.cc.
@@ -337,7 +338,7 @@ void GlassBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
}
void GlassBrowserFrameView::LayoutDistributorLogo() {
- if (distributor_logo_) {
+ if (distributor_logo_ && browser_view_->ShouldShowDistributorLogo()) {
logo_bounds_.SetRect(frame_->GetMinimizeButtonOffset() -
distributor_logo_->width() - kLogoCaptionSpacing, kLogoTopSpacing,
distributor_logo_->width(), distributor_logo_->height());
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc
index 0f6c244..2e8658c 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc
@@ -777,7 +777,8 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
- if (!frame_->IsMaximized() && distributor_logo_) {
+ if (!frame_->IsMaximized() && distributor_logo_ &&
+ browser_view_->ShouldShowDistributorLogo()) {
canvas->DrawBitmapInt(*distributor_logo_,
MirroredLeftPointForRect(logo_bounds_), logo_bounds_.y());
}
@@ -951,7 +952,7 @@ void OpaqueBrowserFrameView::LayoutWindowControls() {
void OpaqueBrowserFrameView::LayoutDistributorLogo() {
// Always lay out the logo, even when it's not present, so we can lay out the
// window title based on its position.
- if (distributor_logo_) {
+ if (distributor_logo_ && browser_view_->ShouldShowDistributorLogo()) {
logo_bounds_.SetRect(minimize_button_->x() - distributor_logo_->width() -
kLogoCaptionSpacing, TopResizeHeight(), distributor_logo_->width(),
distributor_logo_->height());