Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2180)

Unified Diff: chrome/service/remoting/chromoting_host_manager.h

Issue 5955001: Remove chromoting host registration from service process. More IPCs to control (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merges Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/remoting/chromoting_host_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/remoting/chromoting_host_manager.h
diff --git a/chrome/service/remoting/chromoting_host_manager.h b/chrome/service/remoting/chromoting_host_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c510e85ae7c16eb8aced396b2c91170289bfa58
--- /dev/null
+++ b/chrome/service/remoting/chromoting_host_manager.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_
+#define CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_
+
+#include <string>
+
+#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+#include "remoting/host/chromoting_host.h"
+#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/host_config.h"
+
+namespace base {
+class MessageLoopProxy;
+} // namespace base
+
+namespace remoting {
+
+struct ChromotingHostInfo;
+
+// ChromotingHostManager manages chromoting host. It loads config and updates
+// config when necessary, and starts and stops the chromoting host.
+class ChromotingHostManager
+ : public base::RefCountedThreadSafe<ChromotingHostManager> {
+ public:
+
+ // Interface for observer that is notified about the host being
+ // enabled/disabled. Observer is specified in the constructor.
+ class Observer {
+ public:
+ virtual ~Observer() {}
+ virtual void OnChromotingHostEnabled() {}
+ virtual void OnChromotingHostDisabled() {}
+ };
+
+ // Caller keeps ownership of |observer|. |observer| must not be
+ // destroyed while this object exists.
+ ChromotingHostManager(Observer* observer);
+
+ void Initialize(base::MessageLoopProxy* file_message_loop);
+ void Teardown();
+
+ // Return the reference to the chromoting host only if it has started.
+ remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; }
+
+ // Updates credentials used for XMPP connection.
+ void SetCredentials(const std::string& login, const std::string& token);
+
+ bool IsEnabled();
+
+ // Start running the chromoting host asynchronously.
+ void Enable();
+
+ // Stop chromoting host. The shutdown process will happen asynchronously.
+ void Disable();
+
+ void GetHostInfo(ChromotingHostInfo* host_info);
+
+ private:
+ bool IsConfigInitialized();
+ void InitializeConfig();
+
+ void SetEnabled(bool enabled);
+ void Start();
+ void Stop();
+
+ void OnShutdown();
+
+ Observer* observer_;
+
+ scoped_refptr<remoting::MutableHostConfig> chromoting_config_;
+ scoped_ptr<remoting::ChromotingHostContext> chromoting_context_;
+ scoped_refptr<remoting::ChromotingHost> chromoting_host_;
+};
+
+} // namespace remoting
+
+#endif // CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/remoting/chromoting_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698