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

Unified Diff: chromeos/ime/ibus_daemon_controller.h

Issue 12041006: Introduce empty IBusDaemonController class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use thread_checker Created 7 years, 11 months 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 | « chromeos/chromeos.gyp ('k') | chromeos/ime/ibus_daemon_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/ibus_daemon_controller.h
diff --git a/chromeos/ime/ibus_daemon_controller.h b/chromeos/ime/ibus_daemon_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..faa4b52785315c2341a19fd91cfa74c46706baab
--- /dev/null
+++ b/chromeos/ime/ibus_daemon_controller.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2012 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 CHROMEOS_IME_IBUS_DAEMON_CONTROLLER_H_
+#define CHROMEOS_IME_IBUS_DAEMON_CONTROLLER_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/sequenced_task_runner.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+// IBusDaemonController is used to start/stop ibus-daemon process. This class is
+// also watching ibus-daemon process and if it is crashed, re-launch it
+// automatically. This class is managed as Singleton.
+class CHROMEOS_EXPORT IBusDaemonController {
+ public:
+ class Observer {
+ public:
+ // Called when the connection with ibus-daemon is established.
+ virtual void OnConnected() = 0;
+
+ // Called when the connection with ibus-daemon is lost.
+ virtual void OnDisconnected() = 0;
+ };
+
+ virtual ~IBusDaemonController();
+
+ // Initializes IBusDaemonController. ibus-daemon related file handling is
+ // posted to |file_task_runner|.
+ virtual void Initialize(
+ const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
+ const scoped_refptr<base::SequencedTaskRunner>& file_task_runner) = 0;
+
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // Starts ibus-daemon.
+ virtual bool Start() = 0;
+
+ // Stops ibus-daemon.
+ virtual bool Stop() = 0;
+
+ // Returns actual implementation of IBusDaemonController. If the browser is
+ // not running on the Chrome OS device, this function returns stub
+ // implementation.
+ static CHROMEOS_EXPORT IBusDaemonController* GetInstance();
+
+ protected:
+ // IBusDaemonController is managed as singleton. USe GetInstance instead.
+ IBusDaemonController();
+
+ DISALLOW_COPY_AND_ASSIGN(IBusDaemonController);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_IME_IBUS_DAEMON_CONTROLLER_H_
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/ibus_daemon_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698