summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/theme/google_theme_resources.rc15
-rw-r--r--chrome/app/theme/theme_dll.vcproj4
-rw-r--r--chrome/app/theme/theme_resources.rc4
-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
-rw-r--r--chrome/browser/vista_frame.cc55
-rw-r--r--chrome/browser/xp_frame.cc37
-rw-r--r--chrome/common/resource_bundle.cc5
-rw-r--r--chrome/test/accessibility/accessibility_tests.cc2
9 files changed, 56 insertions, 93 deletions
diff --git a/chrome/app/theme/google_theme_resources.rc b/chrome/app/theme/google_theme_resources.rc
deleted file mode 100644
index 5c16eeb..0000000
--- a/chrome/app/theme/google_theme_resources.rc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Resources used by common/*.
-//
-// Paths in this file are relative to the current file.
-
-#include "theme_resources.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// data resources
-//
-
-#if defined(GOOGLE_CHROME_BUILD)
-IDR_DISTRIBUTOR_LOGO BINDATA "distributor_logo.png"
-IDR_DISTRIBUTOR_LOGO_LIGHT BINDATA "distributor_logo_light.png"
-#endif
diff --git a/chrome/app/theme/theme_dll.vcproj b/chrome/app/theme/theme_dll.vcproj
index 66c7925..ea1904d 100644
--- a/chrome/app/theme/theme_dll.vcproj
+++ b/chrome/app/theme/theme_dll.vcproj
@@ -147,10 +147,6 @@
RelativePath="theme_resources.rc"
>
</File>
- <File
- RelativePath="google_theme_resources.rc"
- >
- </File>
</Files>
<Globals>
</Globals>
diff --git a/chrome/app/theme/theme_resources.rc b/chrome/app/theme/theme_resources.rc
index a55f83a..5560c7f 100644
--- a/chrome/app/theme/theme_resources.rc
+++ b/chrome/app/theme/theme_resources.rc
@@ -1,6 +1,6 @@
// Resources used by common/*.
//
-// Paths in this file are relative to current file.
+// Paths in this file are relative to SolutionDir.
#include "theme_resources.h"
@@ -306,3 +306,5 @@ IDR_FIND_DLG_MIDDLE_BB_BACKGROUND BINDATA "find_dlg_middle_bb_bg.png"
IDR_THROBBER_LIGHT BINDATA "throbber_light.png"
IDR_OTR_ICON_STANDALONE BINDATA "otr_icon_standalone.png"
IDR_PRODUCT_LOGO BINDATA "product_logo.png"
+IDR_DISTRIBUTOR_LOGO BINDATA "distributor_logo.png"
+IDR_DISTRIBUTOR_LOGO_LIGHT BINDATA "distributor_logo_light.png"
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 d5d8472..0e05ab9 100644
--- a/chrome/browser/views/frame/aero_glass_non_client_view.cc
+++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc
@@ -248,10 +248,8 @@ int AeroGlassNonClientView::CalculateNonClientTopHeight() const {
}
void AeroGlassNonClientView::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() && !frame_->IsMinimized() &&
- !distributor_logo_.empty()) {
+ // The distributor logo is only painted when the frame is not maximized.
+ if (!frame_->IsMaximized() && !frame_->IsMinimized()) {
canvas->DrawBitmapInt(distributor_logo_, logo_bounds_.x(),
logo_bounds_.y());
}
@@ -321,9 +319,6 @@ 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();
@@ -347,10 +342,7 @@ void AeroGlassNonClientView::InitClass() {
if (!initialized) {
resources_ = new AeroGlassWindowResources;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
- if (!image->isNull())
- distributor_logo_ = *image;
-
+ distributor_logo_ = *rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
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 116b9cb..74ee8b1 100644
--- a/chrome/browser/views/frame/opaque_non_client_view.cc
+++ b/chrome/browser/views/frame/opaque_non_client_view.cc
@@ -812,10 +812,8 @@ void OpaqueNonClientView::PaintOTRAvatar(ChromeCanvas* canvas) {
}
void OpaqueNonClientView::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() && !frame_->IsMinimized() &&
- !distributor_logo_.empty()) {
+ // The distributor logo is only painted when the frame is not maximized.
+ if (!frame_->IsMaximized() && !frame_->IsMinimized()) {
canvas->DrawBitmapInt(distributor_logo_, logo_bounds_.x(),
logo_bounds_.y());
}
@@ -1009,9 +1007,6 @@ void OpaqueNonClientView::LayoutOTRAvatar() {
}
void OpaqueNonClientView::LayoutDistributorLogo() {
- if (distributor_logo_.empty())
- return;
-
int logo_w = distributor_logo_.width();
int logo_h = distributor_logo_.height();
@@ -1068,9 +1063,7 @@ void OpaqueNonClientView::InitClass() {
inactive_resources_ = new InactiveWindowResources;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT);
- if (!image->isNull())
- distributor_logo_ = *image;
+ distributor_logo_ = *rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT);
initialized = true;
}
diff --git a/chrome/browser/vista_frame.cc b/chrome/browser/vista_frame.cc
index 18e3340..bdd3dbbd 100644
--- a/chrome/browser/vista_frame.cc
+++ b/chrome/browser/vista_frame.cc
@@ -249,30 +249,28 @@ 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 (distributor_logo_) {
- if(IsZoomed()) {
- zoomed_offset = std::max(min_offset, kWindowControlsMinOffset);
+ 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,
@@ -450,13 +448,10 @@ void VistaFrame::Init() {
frame_view_->AddChildView(off_the_record_image_);
}
- 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_);
- }
+ distributor_logo_ = new ChromeViews::ImageView();
+ frame_view_->AddViewToDropList(distributor_logo_);
+ distributor_logo_->SetImage(rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO));
+ frame_view_->AddChildView(distributor_logo_);
tab_contents_container_ = new TabContentsContainerView();
frame_view_->AddChildView(tab_contents_container_);
diff --git a/chrome/browser/xp_frame.cc b/chrome/browser/xp_frame.cc
index 666d94b..bb2aefe 100644
--- a/chrome/browser/xp_frame.cc
+++ b/chrome/browser/xp_frame.cc
@@ -476,13 +476,10 @@ void XPFrame::Init() {
frame_view_->AddViewToDropList(off_the_record_image_);
}
- SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT);
- if (!image->isNull()) {
- distributor_logo_ = new ChromeViews::ImageView();
- frame_view_->AddViewToDropList(distributor_logo_);
- distributor_logo_->SetImage(image);
- frame_view_->AddChildView(distributor_logo_);
- }
+ distributor_logo_ = new ChromeViews::ImageView();
+ frame_view_->AddViewToDropList(distributor_logo_);
+ distributor_logo_->SetImage(rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT));
+ frame_view_->AddChildView(distributor_logo_);
min_button_ = new ChromeViews::Button();
min_button_->SetListener(this, MINIATURIZE_TAG);
@@ -720,20 +717,18 @@ void XPFrame::Layout() {
}
}
- if (distributor_logo_) {
- if (IsZoomed()) {
- distributor_logo_->SetVisible(false);
- } else {
- CSize distributor_logo_size;
- distributor_logo_->GetPreferredSize(&distributor_logo_size);
- distributor_logo_->SetVisible(true);
- distributor_logo_->SetBounds(min_button_->GetX() -
- distributor_logo_size.cx -
- kDistributorLogoHorizontalOffset,
- kDistributorLogoVerticalOffset,
- distributor_logo_size.cx,
- distributor_logo_size.cy);
- }
+ if (IsZoomed()) {
+ distributor_logo_->SetVisible(false);
+ } else {
+ CSize distributor_logo_size;
+ distributor_logo_->GetPreferredSize(&distributor_logo_size);
+ distributor_logo_->SetVisible(true);
+ distributor_logo_->SetBounds(min_button_->GetX() -
+ distributor_logo_size.cx -
+ kDistributorLogoHorizontalOffset,
+ kDistributorLogoVerticalOffset,
+ distributor_logo_size.cx,
+ distributor_logo_size.cy);
}
tabstrip_->SetBounds(tab_strip_x, top_margin - 1,
diff --git a/chrome/common/resource_bundle.cc b/chrome/common/resource_bundle.cc
index 09dbf19..3beccb4 100644
--- a/chrome/common/resource_bundle.cc
+++ b/chrome/common/resource_bundle.cc
@@ -195,8 +195,13 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
// Handle the case where loading the bitmap failed.
if (!bitmap) {
LOG(WARNING) << "Unable to load bitmap with id " << resource_id;
+ NOTREACHED(); // Want to assert in debug mode.
if (!empty_bitmap) {
+ // The placeholder bitmap is bright red so people notice the problem.
empty_bitmap = new SkBitmap();
+ empty_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32);
+ empty_bitmap->allocPixels();
+ empty_bitmap->eraseARGB(255, 255, 0, 0);
}
return empty_bitmap;
}
diff --git a/chrome/test/accessibility/accessibility_tests.cc b/chrome/test/accessibility/accessibility_tests.cc
index d13e4b7..f00f9e4 100644
--- a/chrome/test/accessibility/accessibility_tests.cc
+++ b/chrome/test/accessibility/accessibility_tests.cc
@@ -103,7 +103,7 @@ TEST_F(AccessibilityTest, TestChromeTabstripAccObject) {
}
// Check Browser buttons and their Name, Role, State.
-TEST_F(AccessibilityTest, DISABLED_TestChromeButtons) {
+TEST_F(AccessibilityTest, TestChromeButtons) {
HRESULT hr = S_OK;
IAccessible* p_accobj = NULL;
VARIANT button;