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/chromeos/network/tray_vpn.h" | 5 #include "ash/system/chromeos/network/tray_vpn.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/chromeos/network/network_icon_animation.h" | 9 #include "ash/system/chromeos/network/network_icon_animation.h" |
10 #include "ash/system/chromeos/network/network_list_detailed_view_base.h" | 10 #include "ash/system/chromeos/network/network_list_detailed_view_base.h" |
11 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" | 11 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" |
12 #include "ash/system/tray/system_tray.h" | 12 #include "ash/system/tray/system_tray.h" |
13 #include "ash/system/tray/system_tray_delegate.h" | 13 #include "ash/system/tray/system_tray_delegate.h" |
14 #include "ash/system/tray/system_tray_notifier.h" | 14 #include "ash/system/tray/system_tray_notifier.h" |
15 #include "ash/system/tray/tray_constants.h" | 15 #include "ash/system/tray/tray_constants.h" |
16 #include "ash/system/tray/tray_item_more.h" | 16 #include "ash/system/tray/tray_item_more.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "chromeos/network/network_state.h" | 18 #include "chromeos/network/network_state.h" |
19 #include "chromeos/network/network_state_handler.h" | 19 #include "chromeos/network/network_state_handler.h" |
20 #include "grit/ash_strings.h" | 20 #include "grit/ash_strings.h" |
21 #include "third_party/cros_system_api/dbus/service_constants.h" | 21 #include "third_party/cros_system_api/dbus/service_constants.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
24 | 24 |
| 25 using chromeos::NetworkState; |
| 26 using chromeos::NetworkStateHandler; |
| 27 |
25 namespace { | 28 namespace { |
26 | 29 |
27 bool UseNewNetworkHandlers() { | 30 bool UseNewNetworkHandlers() { |
28 return CommandLine::ForCurrentProcess()->HasSwitch( | 31 return !CommandLine::ForCurrentProcess()->HasSwitch( |
29 ash::switches::kAshEnableNewNetworkStatusArea); | 32 ash::switches::kAshDisableNewNetworkStatusArea) && |
| 33 NetworkStateHandler::IsInitialized(); |
30 } | 34 } |
31 | 35 |
32 } | 36 } |
33 | 37 |
34 using chromeos::NetworkState; | |
35 using chromeos::NetworkStateHandler; | |
36 | |
37 namespace ash { | 38 namespace ash { |
38 namespace internal { | 39 namespace internal { |
39 | 40 |
40 namespace tray { | 41 namespace tray { |
41 | 42 |
42 class VpnDefaultView : public TrayItemMore, | 43 class VpnDefaultView : public TrayItemMore, |
43 public network_icon::AnimationObserver { | 44 public network_icon::AnimationObserver { |
44 public: | 45 public: |
45 VpnDefaultView(SystemTrayItem* owner, bool show_more) | 46 VpnDefaultView(SystemTrayItem* owner, bool show_more) |
46 : TrayItemMore(owner, show_more) { | 47 : TrayItemMore(owner, show_more) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 325 } |
325 } | 326 } |
326 | 327 |
327 void TrayVPN::NetworkServiceChanged(const chromeos::NetworkState* network) { | 328 void TrayVPN::NetworkServiceChanged(const chromeos::NetworkState* network) { |
328 if (detailed_) | 329 if (detailed_) |
329 detailed_->NetworkServiceChanged(network); | 330 detailed_->NetworkServiceChanged(network); |
330 } | 331 } |
331 | 332 |
332 } // namespace internal | 333 } // namespace internal |
333 } // namespace ash | 334 } // namespace ash |
OLD | NEW |