Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: chrome/browser/chromeos/status/network_menu.h

Issue 6591017: Cache network connecting bitmaps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/status/network_menu.h
===================================================================
--- chrome/browser/chromeos/status/network_menu.h (revision 75628)
+++ chrome/browser/chromeos/status/network_menu.h (working copy)
@@ -114,26 +114,30 @@
// Cancels the active menu.
void CancelMenu();
+ // The following methods returns pointer to a shared instance of the SkBitmap.
+ // This shared bitmap is owned by the resource bundle and should not be freed.
+
// Returns the Icon for a network strength for a WifiNetwork |wifi|.
// |black| is used to specify whether to return a black icon for display
// on a light background or a white icon for display on a dark background.
- static SkBitmap IconForNetworkStrength(const WifiNetwork* wifi, bool black);
+ static SkBitmap* IconForNetworkStrength(const WifiNetwork* wifi, bool black);
// Returns the Icon for a network strength for CellularNetwork |cellular|.
// |black| is used to specify whether to return a black icon for display
// on a light background or a white icon for display on a dark background.
- static SkBitmap IconForNetworkStrength(const CellularNetwork* cellular,
- bool black);
+ static SkBitmap* IconForNetworkStrength(const CellularNetwork* cellular,
+ bool black);
// Returns the Icon for animating network connecting.
// |animation_value| is the value from Animation.GetCurrentValue()
// |black| is used to specify whether to return a black icon for display
// on a light background or a white icon for display on a dark background.
- static SkBitmap IconForNetworkConnecting(double animation_value, bool black);
+ static SkBitmap* IconForNetworkConnecting(double animation_value, bool black);
// Returns the Badge for a given network technology.
// This returns different colored symbols depending on cellular data left.
- static SkBitmap BadgeForNetworkTechnology(const CellularNetwork* cellular);
+ // Returns NULL if not badge is needed.
+ static SkBitmap* BadgeForNetworkTechnology(const CellularNetwork* cellular);
// This method will convert the |icon| bitmap to the correct size for display.
- // If the |badge| icon is not empty, it will draw that on top of the icon.
- static SkBitmap IconForDisplay(SkBitmap icon, SkBitmap badge);
+ // If the |badge| icon is not NULL, it will draw that on top of the icon.
+ static SkBitmap IconForDisplay(SkBitmap* icon, SkBitmap* badge);
protected:
virtual bool IsBrowserMode() const = 0;
@@ -211,6 +215,12 @@
// static const int kBarsImagesLowData[];
// static const int kBarsImagesVLowData[];
+ // The number of animating images for network connecting.
+ static const int kNumAnimatingImages;
+ // Animation images. These are created lazily.
+ static SkBitmap* kAnimatingImages;
+ static SkBitmap* kAnimatingImagesBlack;
+
// Our menu items.
MenuItemVector menu_items_;

Powered by Google App Engine
This is Rietveld 408576698