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. 4 5#ifndef CHROME_BROWSER_REMOTING_REMOTING_OPTIONS_HANDLER_H_ 6#define CHROME_BROWSER_REMOTING_REMOTING_OPTIONS_HANDLER_H_ 7 8#include "base/basictypes.h" 9#include "chrome/browser/service/service_process_control.h" 10 11class WebUI; 12 13namespace remoting { 14 15// Remoting options handler is responsinble for showing correct status 16// of the chromoting host in the preferences. It listens to the 17// messages from the service process (by registering MessageHandler 18// callback in the ServiceProcessControl) and updates current status 19// as neccessary. 20class RemotingOptionsHandler : public ServiceProcessControl::MessageHandler { 21 public: 22 RemotingOptionsHandler(); 23 virtual ~RemotingOptionsHandler(); 24 25 void Init(WebUI* web_ui); 26 27 // ServiceProcessControl::MessageHandler interface. 28 virtual void OnRemotingHostInfo( 29 const remoting::ChromotingHostInfo& host_info); 30 31 private: 32 void SetStatus(bool enabled, const std::string& login); 33 34 WebUI* web_ui_; 35 ServiceProcessControl* process_control_; 36 37 DISALLOW_COPY_AND_ASSIGN(RemotingOptionsHandler); 38}; 39 40} // namespace remoting 41 42#endif // CHROME_BROWSER_REMOTING_REMOTING_OPTIONS_HANDLER_H_ 43