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

Unified Diff: ash/system/chromeos/network/tray_vpn.cc

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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
Index: ash/system/chromeos/network/tray_vpn.cc
diff --git a/ash/system/chromeos/network/tray_vpn.cc b/ash/system/chromeos/network/tray_vpn.cc
index 05f059621d7490e8842ca495876c673f3c49212d..4f6f02523f0927a116b4db9f92ff634a90deaf2a 100644
--- a/ash/system/chromeos/network/tray_vpn.cc
+++ b/ash/system/chromeos/network/tray_vpn.cc
@@ -23,6 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using chromeos::NetworkHandler;
using chromeos::NetworkState;
using chromeos::NetworkStateHandler;
@@ -30,8 +31,7 @@ namespace {
bool UseNewNetworkHandlers() {
return !CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshDisableNewNetworkStatusArea) &&
- NetworkStateHandler::IsInitialized();
+ ash::switches::kAshDisableNewNetworkStatusArea);
}
}
@@ -57,7 +57,8 @@ class VpnDefaultView : public TrayItemMore,
static bool ShouldShow() {
// Do not show VPN line in uber tray bubble if VPN is not configured.
if (UseNewNetworkHandlers()) {
- NetworkStateHandler* handler = NetworkStateHandler::Get();
+ NetworkStateHandler* handler =
+ NetworkHandler::Get()->network_state_handler();
const NetworkState* vpn = handler->FirstNetworkByType(
flimflam::kTypeVPN);
return vpn != NULL;
@@ -100,7 +101,8 @@ class VpnDefaultView : public TrayItemMore,
void GetNetworkStateHandlerImageAndLabel(gfx::ImageSkia* image,
base::string16* label,
bool* animating) {
- NetworkStateHandler* handler = NetworkStateHandler::Get();
+ NetworkStateHandler* handler =
+ NetworkHandler::Get()->network_state_handler();
const NetworkState* vpn = handler->FirstNetworkByType(
flimflam::kTypeVPN);
if (!vpn || (vpn->connection_state() == flimflam::kStateIdle)) {

Powered by Google App Engine
This is Rietveld 408576698