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

Side by Side Diff: chrome/browser/chromeos/status/network_menu_icon.cc

Issue 8681029: [cros] Make disconnected icons used by network drop-down and network button consistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: default Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/status/network_menu_icon.h" 5 #include "chrome/browser/chromeos/status/network_menu_icon.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 const Network* connected_network_; // weak pointer; used for VPN icons. 445 const Network* connected_network_; // weak pointer; used for VPN icons.
446 NetworkRoamingState roaming_state_; 446 NetworkRoamingState roaming_state_;
447 447
448 DISALLOW_COPY_AND_ASSIGN(NetworkIcon); 448 DISALLOW_COPY_AND_ASSIGN(NetworkIcon);
449 }; 449 };
450 450
451 451
452 //////////////////////////////////////////////////////////////////////////////// 452 ////////////////////////////////////////////////////////////////////////////////
453 // NetworkMenuIcon 453 // NetworkMenuIcon
454 454
455 NetworkMenuIcon::NetworkMenuIcon(Delegate* delegate, Mode mode) 455 NetworkMenuIcon::NetworkMenuIcon(Delegate* delegate, Mode mode,
456 ConnectionType last_network_type)
456 : mode_(mode), 457 : mode_(mode),
457 delegate_(delegate), 458 delegate_(delegate),
458 ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)), 459 ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)),
459 last_network_type_(TYPE_WIFI), 460 last_network_type_(last_network_type),
460 connecting_network_(NULL) { 461 connecting_network_(NULL) {
461 // Generate empty images for blending. 462 // Generate empty images for blending.
462 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 463 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
463 const SkBitmap* vpn_badge = rb.GetBitmapNamed(kVpnBadgeId); 464 const SkBitmap* vpn_badge = rb.GetBitmapNamed(kVpnBadgeId);
464 empty_vpn_badge_.setConfig(SkBitmap::kARGB_8888_Config, 465 empty_vpn_badge_.setConfig(SkBitmap::kARGB_8888_Config,
465 vpn_badge->width(), vpn_badge->height(), 0); 466 vpn_badge->width(), vpn_badge->height(), 0);
466 empty_vpn_badge_.allocPixels(); 467 empty_vpn_badge_.allocPixels();
467 empty_vpn_badge_.eraseARGB(0, 0, 0, 0); 468 empty_vpn_badge_.eraseARGB(0, 0, 0, 0);
468 469
469 // Set up the connection animation throbber. 470 // Set up the connection animation throbber.
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 797
797 const SkBitmap NetworkMenuIcon::GetConnectedBitmap(BitmapType type) { 798 const SkBitmap NetworkMenuIcon::GetConnectedBitmap(BitmapType type) {
798 return GetBitmap(type, NumBitmaps(type) - 1); 799 return GetBitmap(type, NumBitmaps(type) - 1);
799 } 800 }
800 801
801 int NetworkMenuIcon::NumBitmaps(BitmapType type) { 802 int NetworkMenuIcon::NumBitmaps(BitmapType type) {
802 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; 803 return (type == ARCS) ? kNumArcsImages : kNumBarsImages;
803 } 804 }
804 805
805 } // chromeos 806 } // chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698