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_
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"
17 class NetworkDropdownHandler
: public BaseScreenHandler
,
18 public NetworkDropdown::Actor
{
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
;
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
,
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_