| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ash/common/system/chromeos/network/network_list_view_base.h" | 11 #include "ash/common/system/chromeos/network/network_list_view_base.h" |
| 12 #include "ash/common/system/chromeos/network/vpn_delegate.h" | 12 #include "ash/common/system/chromeos/network/vpn_list.h" |
| 13 #include "ash/common/system/tray/view_click_listener.h" | 13 #include "ash/common/system/tray/view_click_listener.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "chromeos/network/network_state_handler.h" | 15 #include "chromeos/network/network_state_handler.h" |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 class NetworkState; | 18 class NetworkState; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 class NetworkListDelegate; | 22 class NetworkListDelegate; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // If there is a connected network, a disconnect button is shown next to its | 35 // If there is a connected network, a disconnect button is shown next to its |
| 36 // name. | 36 // name. |
| 37 // | 37 // |
| 38 // Disconnected networks are arranged in shill's priority order within each | 38 // Disconnected networks are arranged in shill's priority order within each |
| 39 // provider and the providers are arranged in the order of their highest | 39 // provider and the providers are arranged in the order of their highest |
| 40 // priority network. Clicking on a disconnected network triggers a connection | 40 // priority network. Clicking on a disconnected network triggers a connection |
| 41 // attempt. Clicking on the currently connected or connecting network shows its | 41 // attempt. Clicking on the currently connected or connecting network shows its |
| 42 // configuration dialog. Clicking on a provider shows the provider's "add | 42 // configuration dialog. Clicking on a provider shows the provider's "add |
| 43 // network" dialog. | 43 // network" dialog. |
| 44 class VPNListView : public NetworkListViewBase, | 44 class VPNListView : public NetworkListViewBase, |
| 45 public VPNDelegate::Observer, | 45 public VpnList::Observer, |
| 46 public ViewClickListener { | 46 public ViewClickListener { |
| 47 public: | 47 public: |
| 48 explicit VPNListView(NetworkListDelegate* delegate); | 48 explicit VPNListView(NetworkListDelegate* delegate); |
| 49 ~VPNListView() override; | 49 ~VPNListView() override; |
| 50 | 50 |
| 51 // NetworkListViewBase: | 51 // NetworkListViewBase: |
| 52 void Update() override; | 52 void Update() override; |
| 53 bool IsNetworkEntry(views::View* view, | 53 bool IsNetworkEntry(views::View* view, |
| 54 std::string* service_path) const override; | 54 std::string* service_path) const override; |
| 55 | 55 |
| 56 // VPNDelegate::Observer: | 56 // VpnList::Observer: |
| 57 void OnVPNProvidersChanged() override; | 57 void OnVPNProvidersChanged() override; |
| 58 | 58 |
| 59 // ViewClickListener: | 59 // ViewClickListener: |
| 60 void OnViewClicked(views::View* sender) override; | 60 void OnViewClicked(views::View* sender) override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // Adds a network to the list. | 63 // Adds a network to the list. |
| 64 void AddNetwork(const chromeos::NetworkState* network); | 64 void AddNetwork(const chromeos::NetworkState* network); |
| 65 | 65 |
| 66 // Adds the VPN provider identified by |vpn_provider| to the list, along with | 66 // Adds the VPN provider identified by |vpn_provider| to the list, along with |
| (...skipping 18 matching lines...) Expand all Loading... |
| 85 // Whether the list is currently empty (i.e., the next entry added will become | 85 // Whether the list is currently empty (i.e., the next entry added will become |
| 86 // the topmost entry). | 86 // the topmost entry). |
| 87 bool list_empty_ = true; | 87 bool list_empty_ = true; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(VPNListView); | 89 DISALLOW_COPY_AND_ASSIGN(VPNListView); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace ash | 92 } // namespace ash |
| 93 | 93 |
| 94 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ | 94 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_VPN_LIST_VIEW_H_ |
| OLD | NEW |