diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 00:42:41 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 00:42:41 +0000 |
commit | 8edf3bb8a0b6b1d61b392dd7612558b9bafed02a (patch) | |
tree | 06b099df0696d9f9932158f62007fa0c1f79e102 /chrome/browser | |
parent | a6ec0897e904792a60a12a58b26dd2214dbcfa39 (diff) | |
download | chromium_src-8edf3bb8a0b6b1d61b392dd7612558b9bafed02a.zip chromium_src-8edf3bb8a0b6b1d61b392dd7612558b9bafed02a.tar.gz chromium_src-8edf3bb8a0b6b1d61b392dd7612558b9bafed02a.tar.bz2 |
Display only static background page badges. New art coming in a separate CL.
BUG=64144
TEST=enable extension with background page, see badge
Review URL: http://codereview.chromium.org/6057008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/ui/toolbar/wrench_menu_model.cc | 20 | ||||
-rw-r--r-- | chrome/browser/ui/views/toolbar_view.cc | 20 |
2 files changed, 3 insertions, 37 deletions
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index e82fb08..a68922f 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -28,7 +28,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" #include "chrome/browser/upgrade_detector.h" -#include "chrome/common/badge_util.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_source.h" @@ -56,22 +55,6 @@ #include "chrome/browser/enumerate_modules_model_win.h" #endif -// The size of the font used for dynamic text overlays on menu items. -const float kMenuBadgeFontSize = 12.0; - -namespace { -SkBitmap GetBackgroundPageIcon() { - string16 pages = base::FormatNumber( - BackgroundPageTracker::GetInstance()->GetBackgroundPageCount()); - return badge_util::DrawBadgeIconOverlay( - *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_BACKGROUND_MENU), - kMenuBadgeFontSize, - pages, - l10n_util::GetStringUTF16(IDS_BACKGROUND_PAGE_BADGE_OVERFLOW)); -} - -} // namespace - //////////////////////////////////////////////////////////////////////////////// // EncodingMenuModel @@ -248,7 +231,8 @@ bool WrenchMenuModel::GetIconForCommandId(int command_id, int num_pages = BackgroundPageTracker::GetInstance()-> GetUnacknowledgedBackgroundPageCount(); if (num_pages > 0) { - *bitmap = GetBackgroundPageIcon(); + *bitmap = *ResourceBundle::GetSharedInstance().GetBitmapNamed( + IDR_BACKGROUND_MENU); return true; } else { // No icon. diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index 5b22d5c..bf221e2 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -22,7 +22,6 @@ #include "chrome/browser/ui/views/event_utils.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/upgrade_detector.h" -#include "chrome/common/badge_util.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "gfx/canvas.h" @@ -73,10 +72,6 @@ static const int kPopupTopSpacingNonGlass = 3; static const int kPopupBottomSpacingNonGlass = 2; static const int kPopupBottomSpacingGlass = 1; -// The size of the font to use in the text overlay for the background page -// badge. -static const float kBadgeTextFontSize = 9.0; - // Top margin for the wrench menu badges (badge is placed in the upper right // corner of the wrench menu). static const int kBadgeTopMargin = 2; @@ -755,7 +750,7 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) { if (IsUpgradeRecommended()) { badge = *tp->GetBitmapNamed(IDR_UPDATE_BADGE); } else if (ShouldShowBackgroundPageBadge()) { - badge = GetBackgroundPageBadge(); + badge = *tp->GetBitmapNamed(IDR_BACKGROUND_BADGE); } else if (ShouldShowIncompatibilityWarning()) { #if defined(OS_WIN) badge = *tp->GetBitmapNamed(IDR_CONFLICT_BADGE); @@ -770,16 +765,3 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) { return canvas->ExtractBitmap(); } - -SkBitmap ToolbarView::GetBackgroundPageBadge() { - ThemeProvider* tp = GetThemeProvider(); - SkBitmap* badge = tp->GetBitmapNamed(IDR_BACKGROUND_BADGE); - string16 badge_text = base::FormatNumber( - BackgroundPageTracker::GetInstance()->GetBackgroundPageCount()); - return badge_util::DrawBadgeIconOverlay( - *badge, - kBadgeTextFontSize, - badge_text, - l10n_util::GetStringUTF16(IDS_BACKGROUND_PAGE_BADGE_OVERFLOW)); -} - |