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_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_VIEW_BASE_H_ | |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_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 | |
18 // Base class for a list of available networks (and, in the case of VPNs, the | |
19 // list of available VPN providers). | |
20 class NetworkListViewBase { | |
21 public: | |
22 NetworkListViewBase(); | |
23 virtual ~NetworkListViewBase(); | |
24 | |
25 void set_container(views::View* container) { container_ = container; } | |
26 | |
27 // Refreshes the network list. | |
28 virtual void Update() = 0; | |
29 | |
30 // Checks whether |view| represents a network in the list. If yes, sets | |
31 // |guid| to the network's guid and returns |true|. Otherwise, | |
32 // leaves |guid| unchanged and returns |false|. | |
33 virtual bool IsNetworkEntry(views::View* view, std::string* guid) const = 0; | |
34 | |
35 protected: | |
36 views::View* container() { return container_; } | |
37 | |
38 private: | |
39 // The container that holds the actual list entries. | |
40 views::View* container_ = nullptr; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(NetworkListViewBase); | |
43 }; | |
44 | |
45 } // namespace ash | |
46 | |
47 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_LIST_VIEW_BASE_H_ | |
OLD | NEW |