| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_SYSTEM_NETWORK_NETWORK_LIST_VIEW_BASE_H_ | |
| 6 #define ASH_SYSTEM_NETWORK_NETWORK_LIST_VIEW_BASE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 namespace views { | |
| 13 class View; | |
| 14 } | |
| 15 | |
| 16 namespace ash { | |
| 17 namespace tray { | |
| 18 class NetworkStateListDetailedView; | |
| 19 } | |
| 20 | |
| 21 // Base class for a list of available networks (and, in the case of VPNs, the | |
| 22 // list of available VPN providers). | |
| 23 class NetworkListViewBase { | |
| 24 public: | |
| 25 virtual ~NetworkListViewBase(); | |
| 26 | |
| 27 void set_container(views::View* container) { container_ = container; } | |
| 28 | |
| 29 // Refreshes the network list. | |
| 30 virtual void Update() = 0; | |
| 31 | |
| 32 // Checks whether |view| represents a network in the list. If yes, sets | |
| 33 // |guid| to the network's guid and returns |true|. Otherwise, | |
| 34 // leaves |guid| unchanged and returns |false|. | |
| 35 virtual bool IsNetworkEntry(views::View* view, std::string* guid) const = 0; | |
| 36 | |
| 37 protected: | |
| 38 explicit NetworkListViewBase( | |
| 39 tray::NetworkStateListDetailedView* detailed_view); | |
| 40 | |
| 41 tray::NetworkStateListDetailedView* detailed_view() const { | |
| 42 return detailed_view_; | |
| 43 } | |
| 44 | |
| 45 views::View* container() const { return container_; } | |
| 46 | |
| 47 private: | |
| 48 tray::NetworkStateListDetailedView* const detailed_view_; | |
| 49 | |
| 50 // The container that holds the actual list entries. | |
| 51 views::View* container_ = nullptr; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(NetworkListViewBase); | |
| 54 }; | |
| 55 | |
| 56 } // namespace ash | |
| 57 | |
| 58 #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_VIEW_BASE_H_ | |
| OLD | NEW |