local_discovery_ui_handler.h revision 9ab5563a3196760eb381d102cbb2bc0f7abc6a50
1// Copyright 2013 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 CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_
6#define CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_
7
8#include "content/public/browser/user_metrics.h"
9#include "content/public/browser/web_ui_message_handler.h"
10
11// UI Handler for chrome://devices/
12// It listens to local discovery notifications and passes those notifications
13// into the Javascript to update the page.
14class LocalDiscoveryUIHandler : public content::WebUIMessageHandler {
15 public:
16  LocalDiscoveryUIHandler();
17  virtual ~LocalDiscoveryUIHandler();
18
19  // WebUIMessageHandler implementation.
20  // Does nothing for now.
21  virtual void RegisterMessages() OVERRIDE;
22
23 private:
24  // Callback for adding new device to the devices page.
25  // |name| contains a user friendly name of the device.
26  void OnNewDevice(const std::string& name);
27
28  content::ActionCallback action_callback_;
29
30  DISALLOW_COPY_AND_ASSIGN(LocalDiscoveryUIHandler);
31};
32
33#endif  // CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_
34