summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.cc14
-rw-r--r--chrome/browser/views/frame/opaque_non_client_view.cc13
2 files changed, 21 insertions, 6 deletions
diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc
index 0e05ab9..d5d8472 100644
--- a/chrome/browser/views/frame/aero_glass_non_client_view.cc
+++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc
@@ -248,8 +248,10 @@ int AeroGlassNonClientView::CalculateNonClientTopHeight() const {
}
void AeroGlassNonClientView::PaintDistributorLogo(ChromeCanvas* canvas) {
- // The distributor logo is only painted when the frame is not maximized.
- if (!frame_->IsMaximized() && !frame_->IsMinimized()) {
+ // The distributor logo is only painted when the frame is not maximized and
+ // when we actually have a logo.
+ if (!frame_->IsMaximized() && !frame_->IsMinimized() &&
+ !distributor_logo_.empty()) {
canvas->DrawBitmapInt(distributor_logo_, logo_bounds_.x(),
logo_bounds_.y());
}
@@ -319,6 +321,9 @@ void AeroGlassNonClientView::PaintClientEdge(ChromeCanvas* canvas) {
}
void AeroGlassNonClientView::LayoutDistributorLogo() {
+ if (distributor_logo_.empty())
+ return;
+
int logo_w = distributor_logo_.width();
int logo_h = distributor_logo_.height();
@@ -342,7 +347,10 @@ void AeroGlassNonClientView::InitClass() {
if (!initialized) {
resources_ = new AeroGlassWindowResources;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- distributor_logo_ = *rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
+ SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
+ if (!image->isNull())
+ distributor_logo_ = *image;
+
initialized = true;
}
}
diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc
index 74ee8b1..116b9cb 100644
--- a/chrome/browser/views/frame/opaque_non_client_view.cc
+++ b/chrome/browser/views/frame/opaque_non_client_view.cc
@@ -812,8 +812,10 @@ void OpaqueNonClientView::PaintOTRAvatar(ChromeCanvas* canvas) {
}
void OpaqueNonClientView::PaintDistributorLogo(ChromeCanvas* canvas) {
- // The distributor logo is only painted when the frame is not maximized.
- if (!frame_->IsMaximized() && !frame_->IsMinimized()) {
+ // The distributor logo is only painted when the frame is not maximized and
+ // when we actually have a logo.
+ if (!frame_->IsMaximized() && !frame_->IsMinimized() &&
+ !distributor_logo_.empty()) {
canvas->DrawBitmapInt(distributor_logo_, logo_bounds_.x(),
logo_bounds_.y());
}
@@ -1007,6 +1009,9 @@ void OpaqueNonClientView::LayoutOTRAvatar() {
}
void OpaqueNonClientView::LayoutDistributorLogo() {
+ if (distributor_logo_.empty())
+ return;
+
int logo_w = distributor_logo_.width();
int logo_h = distributor_logo_.height();
@@ -1063,7 +1068,9 @@ void OpaqueNonClientView::InitClass() {
inactive_resources_ = new InactiveWindowResources;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- distributor_logo_ = *rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT);
+ SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT);
+ if (!image->isNull())
+ distributor_logo_ = *image;
initialized = true;
}