diff options
author | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 17:01:42 +0000 |
---|---|---|
committer | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 17:01:42 +0000 |
commit | 0d9b46841a609c598ca8ded416e2adfca2be9d48 (patch) | |
tree | 4211bf9c20894b06a965ea8bfdb3a9a009cba80d /chrome/browser/vista_frame.cc | |
parent | e4f2d631670f61c442fca79ce08050a90fb35505 (diff) | |
download | chromium_src-0d9b46841a609c598ca8ded416e2adfca2be9d48.zip chromium_src-0d9b46841a609c598ca8ded416e2adfca2be9d48.tar.gz chromium_src-0d9b46841a609c598ca8ded416e2adfca2be9d48.tar.bz2 |
Do not display "Google" in titlebar of Chromium builds.
- Create a new resource file that will contain Google Chrome specific resources. Ideally this new resource file should not be in the Chromium project at all but there doesnt seem to be any way to do conditional includes in vcproj files. So we ifdef its contents.
- Make distributor logo optional. If we do not find it, we do not try to paint/layout logo.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/vista_frame.cc')
-rw-r--r-- | chrome/browser/vista_frame.cc | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/chrome/browser/vista_frame.cc b/chrome/browser/vista_frame.cc index bdd3dbbd..18e3340 100644 --- a/chrome/browser/vista_frame.cc +++ b/chrome/browser/vista_frame.cc @@ -249,28 +249,30 @@ void VistaFrame::Layout() { // If we are maxmized, the tab strip will be in line with the window // controls, so we need to make sure they don't overlap. int zoomed_offset = 0; - if(IsZoomed()) { - zoomed_offset = std::max(min_offset, kWindowControlsMinOffset); + if (distributor_logo_) { + if(IsZoomed()) { + zoomed_offset = std::max(min_offset, kWindowControlsMinOffset); - // Hide the distributor logo if we're zoomed. - distributor_logo_->SetVisible(false); - } else { - CSize distributor_logo_size; - distributor_logo_->GetPreferredSize(&distributor_logo_size); - - int logo_x; - // Because of Bug 1128173, our Window controls aren't actually flipped - // on Vista, yet all our math and layout presumes that they are. - if (frame_view_->UILayoutIsRightToLeft()) - logo_x = width - distributor_logo_size.cx; - else - logo_x = width - min_offset - distributor_logo_size.cx; - - distributor_logo_->SetVisible(true); - distributor_logo_->SetBounds(logo_x, - kDistributorLogoVerticalOffset, - distributor_logo_size.cx, - distributor_logo_size.cy); + // Hide the distributor logo if we're zoomed. + distributor_logo_->SetVisible(false); + } else { + CSize distributor_logo_size; + distributor_logo_->GetPreferredSize(&distributor_logo_size); + + int logo_x; + // Because of Bug 1128173, our Window controls aren't actually flipped + // on Vista, yet all our math and layout presumes that they are. + if (frame_view_->UILayoutIsRightToLeft()) + logo_x = width - distributor_logo_size.cx; + else + logo_x = width - min_offset - distributor_logo_size.cx; + + distributor_logo_->SetVisible(true); + distributor_logo_->SetBounds(logo_x, + kDistributorLogoVerticalOffset, + distributor_logo_size.cx, + distributor_logo_size.cy); + } } gfx::Rect tabstrip_bounds(tabstrip_x, @@ -448,10 +450,13 @@ void VistaFrame::Init() { frame_view_->AddChildView(off_the_record_image_); } - distributor_logo_ = new ChromeViews::ImageView(); - frame_view_->AddViewToDropList(distributor_logo_); - distributor_logo_->SetImage(rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO)); - frame_view_->AddChildView(distributor_logo_); + SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); + if (!image->isNull()) { + distributor_logo_ = new ChromeViews::ImageView(); + frame_view_->AddViewToDropList(distributor_logo_); + distributor_logo_->SetImage(image); + frame_view_->AddChildView(distributor_logo_); + } tab_contents_container_ = new TabContentsContainerView(); frame_view_->AddChildView(tab_contents_container_); |