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(
24 const std::string
& service_path
) = 0;
27 NetworkDropdownHandler();
28 virtual ~NetworkDropdownHandler();
30 void AddObserver(Observer
* observer
);
31 void RemoveObserver(Observer
* observer
);
33 // BaseScreenHandler implementation:
34 virtual void DeclareLocalizedValues(LocalizedValuesBuilder
* builder
) OVERRIDE
;
35 virtual void Initialize() OVERRIDE
;
37 // WebUIMessageHandler implementation:
38 virtual void RegisterMessages() OVERRIDE
;
41 // NetworkDropdown::Actor implementation:
42 virtual void OnConnectToNetworkRequested(
43 const std::string
& service_path
) OVERRIDE
;
45 // Handles choosing of the network menu item.
46 void HandleNetworkItemChosen(double id
);
47 // Handles network drop-down showing.
48 void HandleNetworkDropdownShow(const std::string
& element_id
,
50 // Handles network drop-down hiding.
51 void HandleNetworkDropdownHide();
52 // Handles network drop-down refresh.
53 void HandleNetworkDropdownRefresh();
55 scoped_ptr
<NetworkDropdown
> dropdown_
;
57 ObserverList
<Observer
> observers_
;
59 DISALLOW_COPY_AND_ASSIGN(NetworkDropdownHandler
);
62 } // namespace chromeos
63 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_