Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / network_dropdown_handler.h
blobf4705c0d49caa3e784b25d6d0e1590672108d219
1 // Copyright (c) 2011 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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/observer_list.h"
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
13 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h"
15 namespace chromeos {
17 class NetworkDropdownHandler : public BaseScreenHandler,
18 public NetworkDropdown::Actor {
19 public:
20 class Observer {
21 public:
22 virtual ~Observer() {}
23 virtual void OnConnectToNetworkRequested() = 0;
26 NetworkDropdownHandler();
27 ~NetworkDropdownHandler() override;
29 void AddObserver(Observer* observer);
30 void RemoveObserver(Observer* observer);
32 // BaseScreenHandler implementation:
33 void DeclareLocalizedValues(
34 ::login::LocalizedValuesBuilder* builder) override;
35 void Initialize() override;
37 // WebUIMessageHandler implementation:
38 void RegisterMessages() override;
40 private:
41 // NetworkDropdown::Actor implementation:
42 void OnConnectToNetworkRequested() override;
44 // Handles choosing of the network menu item.
45 void HandleNetworkItemChosen(double id);
46 // Handles network drop-down showing.
47 void HandleNetworkDropdownShow(const std::string& element_id,
48 bool oobe);
49 // Handles network drop-down hiding.
50 void HandleNetworkDropdownHide();
51 // Handles network drop-down refresh.
52 void HandleNetworkDropdownRefresh();
54 scoped_ptr<NetworkDropdown> dropdown_;
56 base::ObserverList<Observer> observers_;
58 DISALLOW_COPY_AND_ASSIGN(NetworkDropdownHandler);
61 } // namespace chromeos
62 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_