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

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

Issue 23484018: Avoid dereferencing a NULL DeviceState in NetworkIconImpl::GetBadges(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 8 #include "ash/system/chromeos/network/network_icon_animation.h"
9 #include "ash/system/chromeos/network/network_icon_animation_observer.h" 9 #include "ash/system/chromeos/network/network_icon_animation_observer.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } else if (type == flimflam::kTypeWimax) { 613 } else if (type == flimflam::kTypeWimax) {
614 technology_badge_ = rb.GetImageSkiaNamed( 614 technology_badge_ = rb.GetImageSkiaNamed(
615 IconTypeIsDark(icon_type_) ? 615 IconTypeIsDark(icon_type_) ?
616 IDR_AURA_UBER_TRAY_NETWORK_4G_DARK : 616 IDR_AURA_UBER_TRAY_NETWORK_4G_DARK :
617 IDR_AURA_UBER_TRAY_NETWORK_4G_LIGHT); 617 IDR_AURA_UBER_TRAY_NETWORK_4G_LIGHT);
618 } else if (type == flimflam::kTypeCellular) { 618 } else if (type == flimflam::kTypeCellular) {
619 if (network->roaming() == flimflam::kRoamingStateRoaming) { 619 if (network->roaming() == flimflam::kRoamingStateRoaming) {
620 // For networks that are always in roaming don't show roaming badge. 620 // For networks that are always in roaming don't show roaming badge.
621 const DeviceState* device = 621 const DeviceState* device =
622 handler->GetDeviceState(network->device_path()); 622 handler->GetDeviceState(network->device_path());
623 DCHECK(device); 623 LOG_IF(WARNING, !device) << "Could not find device state for "
624 if (!device->provider_requires_roaming()) { 624 << network->device_path();
625 if (!device || !device->provider_requires_roaming()) {
stevenjb 2013/09/09 17:21:24 Should't this be (device && !device->provider_requ
625 badges->bottom_right = rb.GetImageSkiaNamed( 626 badges->bottom_right = rb.GetImageSkiaNamed(
626 IconTypeIsDark(icon_type_) ? 627 IconTypeIsDark(icon_type_) ?
627 IDR_AURA_UBER_TRAY_NETWORK_ROAMING_DARK : 628 IDR_AURA_UBER_TRAY_NETWORK_ROAMING_DARK :
628 IDR_AURA_UBER_TRAY_NETWORK_ROAMING_LIGHT); 629 IDR_AURA_UBER_TRAY_NETWORK_ROAMING_LIGHT);
629 } 630 }
630 } 631 }
631 } 632 }
632 if (!network->IsConnectingState()) { 633 if (!network->IsConnectingState()) {
633 badges->top_left = technology_badge_; 634 badges->top_left = technology_badge_;
634 badges->bottom_left = vpn_badge_; 635 badges->bottom_left = vpn_badge_;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 iter != networks.end(); ++iter) { 841 iter != networks.end(); ++iter) {
841 network_paths.insert((*iter)->path()); 842 network_paths.insert((*iter)->path());
842 } 843 }
843 PurgeIconMap(ICON_TYPE_TRAY, network_paths); 844 PurgeIconMap(ICON_TYPE_TRAY, network_paths);
844 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); 845 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths);
845 PurgeIconMap(ICON_TYPE_LIST, network_paths); 846 PurgeIconMap(ICON_TYPE_LIST, network_paths);
846 } 847 }
847 848
848 } // namespace network_icon 849 } // namespace network_icon
849 } // namespace ash 850 } // namespace ash
OLDNEW
« 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