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

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: - 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
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..738e6d71026a27e9aa8a1cd38102a9f78a0a2539
--- /dev/null
+++ b/chrome/service/remoting/chromoting_host_manager.h
@@ -0,0 +1,74 @@
+// 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;
+
+class ChromotingHostManager
Alpha Left Google 2010/12/16 21:32:44 Comments here about what this class is doing.
Sergey Ulanov 2010/12/17 00:05:43 Done.
+ : public base::RefCountedThreadSafe<ChromotingHostManager> {
+ public:
+ class Observer {
Alpha Left Google 2010/12/16 21:32:44 Also comments here.
Sergey Ulanov 2010/12/17 00:05:43 Done.
+ public:
+ virtual ~Observer() {}
+ virtual void OnChromotingHostEnabled() {}
+ virtual void OnChromotingHostDisabled() {}
+ };
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698