diff options
author | idanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 18:39:38 +0000 |
---|---|---|
committer | idanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 18:39:38 +0000 |
commit | cf87a79279f03f3d6b6fc2542f1e43455bf7e8f1 (patch) | |
tree | ce256f0e32d8ac0fedeefe9c869cb59edcdc25e1 /chrome | |
parent | b1a9a1f8ef76800c09b8f035c5c9f7a5f02b03ed (diff) | |
download | chromium_src-cf87a79279f03f3d6b6fc2542f1e43455bf7e8f1.zip chromium_src-cf87a79279f03f3d6b6fc2542f1e43455bf7e8f1.tar.gz chromium_src-cf87a79279f03f3d6b6fc2542f1e43455bf7e8f1.tar.bz2 |
Issue 12160: Crash
This represents crash #8 of the 2.0.180 branch, likely to
be caused by people playing with themese or have downloaded
a DLL to replace the Chrome theme from somewhere other than
us. No repro-steps, so the best is to avoid the problem.
BUG=12160
TEST=none
Review URL: http://codereview.chromium.org/115523
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 085bc92..360428e 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -2369,6 +2369,12 @@ each locale. --> <message name="IDS_UPGRADE_ERROR" desc="Status label: Error occurred during upgrade"> Update server not available (error: <ph name="ERROR_NUMBER">$1<ex>1</ex></ph>) </message> + <message name="IDS_RESOURCE_ERROR" desc="Error loading resource"> + An error was encountered while loading a program resource. Try reinstalling. + </message> + <message name="IDS_RESOURCE_ERROR_CAPTION" desc="Error loading resource caption"> + Resource Error + </message> <!-- Print --> <message name="IDS_DEFAULT_PRINT_DOCUMENT_TITLE" desc="Default title for a print document"> diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 659e5a8..0cd40cb 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -23,6 +23,10 @@ #include "views/window/non_client_view.h" #include "views/window/window.h" +#ifdef WIN32 +#include "app/win_util.h" +#endif + static const int kLeftPadding = 16; static const int kTopPadding = 6; static const int kRightPadding = 15; @@ -94,6 +98,26 @@ void InitResources() { loading_animation_frame_count = loading_animation_frames->width() / loading_animation_frames->height(); + // We get a DIV0 further down when the throbber is replaced by an image + // which is taller than wide. In this case we cannot deduce an animation + // sequence from it since we assume that each animation frame has the width + // of the image's height. + if (loading_animation_frame_count == 0) { +#ifdef WIN32 + // TODO(idanan): Remove this when we have a way to handle theme errors. + // See: http://code.google.com/p/chromium/issues/detail?id=12531 + // For now, this is Windows-specific because some users have downloaded + // a DLL from outside of Google to override the theme. + std::wstring text = l10n_util::GetString(IDS_RESOURCE_ERROR); + std::wstring caption = l10n_util::GetString(IDS_RESOURCE_ERROR_CAPTION); + UINT flags = MB_OK | MB_ICONWARNING | MB_TOPMOST; + win_util::MessageBox(NULL, text, caption, flags); +#endif + CHECK(loading_animation_frame_count) << "Invalid throbber size. Width = " + << loading_animation_frames->width() << ", height = " + << loading_animation_frames->height(); + } + waiting_animation_frames = rb.GetBitmapNamed(IDR_THROBBER_WAITING); DCHECK(waiting_animation_frames); DCHECK(waiting_animation_frames->width() % |