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

Side by Side Diff: ash/system/chromeos/network/network_icon.cc

Issue 11614035: Improve NetworkStateHandler API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separate out OnDefaultNetworkChanged and move kMatchType* to NetworkStateHandler Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/system/chromeos/network/network_icon.h" 5 #include "ash/system/chromeos/network/network_icon.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/chromeos/network/network_icon_animation_observer.h" 8 #include "ash/system/chromeos/network/network_icon_animation_observer.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "chromeos/network/device_state.h" 10 #include "chromeos/network/device_state.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 technology_badge_(NULL) { 475 technology_badge_(NULL) {
476 // Default image 476 // Default image
477 image_ = GetDisconnectedImage(color); 477 image_ = GetDisconnectedImage(color);
478 } 478 }
479 479
480 void NetworkIconImpl::Update(const NetworkState* network) { 480 void NetworkIconImpl::Update(const NetworkState* network) {
481 // Determine whether or not we need to update the icon. 481 // Determine whether or not we need to update the icon.
482 bool dirty = image_.isNull(); 482 bool dirty = image_.isNull();
483 483
484 // If the network state has changed, the icon needs updating. 484 // If the network state has changed, the icon needs updating.
485 if (state_ != network->state()) { 485 if (state_ != network->connection_state()) {
486 state_ = network->state(); 486 state_ = network->connection_state();
487 dirty = true; 487 dirty = true;
488 } 488 }
489 489
490 const std::string& type = network->type(); 490 const std::string& type = network->type();
491 if (type != flimflam::kTypeEthernet) 491 if (type != flimflam::kTypeEthernet)
492 dirty |= UpdateWirelessStrengthIndex(network); 492 dirty |= UpdateWirelessStrengthIndex(network);
493 493
494 if (type == flimflam::kTypeCellular) 494 if (type == flimflam::kTypeCellular)
495 dirty |= UpdateCellularState(network); 495 dirty |= UpdateCellularState(network);
496 496
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 icon = iter->second; 560 icon = iter->second;
561 } 561 }
562 562
563 // Update and return the icon's image. 563 // Update and return the icon's image.
564 icon->Update(network); 564 icon->Update(network);
565 return icon->image(); 565 return icon->image();
566 } 566 }
567 567
568 } // namespace network_icon 568 } // namespace network_icon
569 } // namespace ash 569 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698