Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/network/network_icon.h" | 5 #include "ash/system/network/network_icon.h" |
| 6 | 6 |
| 7 #include "ash/resources/vector_icons/vector_icons.h" | 7 #include "ash/resources/vector_icons/vector_icons.h" |
| 8 #include "ash/strings/grit/ash_strings.h" | 8 #include "ash/strings/grit/ash_strings.h" |
| 9 #include "ash/system/network/network_icon_animation.h" | 9 #include "ash/system/network/network_icon_animation.h" |
| 10 #include "ash/system/network/network_icon_animation_observer.h" | 10 #include "ash/system/network/network_icon_animation_observer.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 609 //------------------------------------------------------------------------------ | 609 //------------------------------------------------------------------------------ |
| 610 // NetworkIconImpl | 610 // NetworkIconImpl |
| 611 | 611 |
| 612 NetworkIconImpl::NetworkIconImpl(const std::string& path, | 612 NetworkIconImpl::NetworkIconImpl(const std::string& path, |
| 613 IconType icon_type, | 613 IconType icon_type, |
| 614 const std::string& network_type) | 614 const std::string& network_type) |
| 615 : network_path_(path), | 615 : network_path_(path), |
| 616 icon_type_(icon_type), | 616 icon_type_(icon_type), |
| 617 strength_index_(-1), | 617 strength_index_(-1), |
| 618 behind_captive_portal_(false) { | 618 behind_captive_portal_(false) { |
| 619 // Default image | 619 // Default image is null. |
|
stevenjb
2017/05/10 17:02:57
This is probably fine. Make sure to test both the
| |
| 620 image_ = GetBasicImage(false, icon_type, network_type); | |
| 621 } | 620 } |
| 622 | 621 |
| 623 void NetworkIconImpl::Update(const NetworkState* network) { | 622 void NetworkIconImpl::Update(const NetworkState* network) { |
| 624 DCHECK(network); | 623 DCHECK(network); |
| 625 // Determine whether or not we need to update the icon. | 624 // Determine whether or not we need to update the icon. |
| 626 bool dirty = image_.isNull(); | 625 bool dirty = image_.isNull(); |
| 627 | 626 |
| 628 // If the network state has changed, the icon needs updating. | 627 // If the network state has changed, the icon needs updating. |
| 629 if (state_ != network->connection_state()) { | 628 if (state_ != network->connection_state()) { |
| 630 state_ = network->connection_state(); | 629 state_ = network->connection_state(); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 994 network_paths.insert((*iter)->path()); | 993 network_paths.insert((*iter)->path()); |
| 995 } | 994 } |
| 996 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 997 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 998 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 997 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 999 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
| 1000 } | 999 } |
| 1001 | 1000 |
| 1002 } // namespace network_icon | 1001 } // namespace network_icon |
| 1003 } // namespace ash | 1002 } // namespace ash |
| OLD | NEW |