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

Unified Diff: chrome/browser/chromeos/status/network_menu_icon.cc

Issue 8207009: Track cellular badge in icon cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/network_menu_icon.cc
diff --git a/chrome/browser/chromeos/status/network_menu_icon.cc b/chrome/browser/chromeos/status/network_menu_icon.cc
index 20d76bcc6590498f10e6ebcac82589931fdbf661..18c29026870cceeb033a8cd7b6c2de7ed83b1a62 100644
--- a/chrome/browser/chromeos/status/network_menu_icon.cc
+++ b/chrome/browser/chromeos/status/network_menu_icon.cc
@@ -157,7 +157,8 @@ class NetworkIcon {
bottom_left_badge_(NULL),
bottom_right_badge_(NULL),
is_status_bar_(true),
- connected_network_(NULL) {
+ connected_network_(NULL),
+ roaming_state_(ROAMING_STATE_UNKNOWN) {
}
// Service path constructor for cached network service icons.
@@ -170,7 +171,8 @@ class NetworkIcon {
bottom_left_badge_(NULL),
bottom_right_badge_(NULL),
is_status_bar_(false),
- connected_network_(NULL) {
+ connected_network_(NULL),
+ roaming_state_(ROAMING_STATE_UNKNOWN) {
}
~NetworkIcon() {
@@ -223,7 +225,19 @@ class NetworkIcon {
strength_index_ = index;
dirty = true;
}
- } else if (type == TYPE_VPN) {
+ }
+ if (type == TYPE_CELLULAR) {
+ const CellularNetwork* cellular =
+ static_cast<const CellularNetwork*>(network);
+ const SkBitmap* technology_badge = BadgeForNetworkTechnology(cellular);
+ if (technology_badge != bottom_right_badge_)
+ dirty = true;
+ if (cellular->roaming_state() != roaming_state_) {
+ roaming_state_ = cellular->roaming_state();
+ dirty = true;
+ }
+ }
+ if (type == TYPE_VPN) {
if (cros->connected_network() != connected_network_) {
connected_network_ = cros->connected_network();
dirty = true;
@@ -391,6 +405,7 @@ class NetworkIcon {
const SkBitmap* bottom_right_badge_;
bool is_status_bar_;
const Network* connected_network_; // weak pointer; used for VPN icons.
+ NetworkRoamingState roaming_state_;
DISALLOW_COPY_AND_ASSIGN(NetworkIcon);
};
@@ -403,7 +418,8 @@ NetworkMenuIcon::NetworkMenuIcon(Delegate* delegate, Mode mode)
: mode_(mode),
delegate_(delegate),
ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)),
- last_network_type_(TYPE_WIFI) {
+ last_network_type_(TYPE_WIFI),
+ connecting_network_(NULL) {
// Generate empty images for blending.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const SkBitmap* vpn_badge = rb.GetBitmapNamed(kVpnBadgeId);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698