Index: chrome/browser/chromeos/dbus/console_service_provider.h |
diff --git a/chrome/browser/chromeos/dbus/console_service_provider.h b/chrome/browser/chromeos/dbus/console_service_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c3f0930ff96b3ce3ce2833003e24c308aa48fb64 |
--- /dev/null |
+++ b/chrome/browser/chromeos/dbus/console_service_provider.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2014 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_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_ |
+#define CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_ |
+ |
stevenjb
2014/11/03 16:35:42
#Include <string>
dsodman
2014/11/04 05:19:40
Done.
|
+#include "base/bind.h" |
+#include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
+#include "dbus/exported_object.h" |
+#include "dbus/message.h" |
stevenjb
2014/11/03 16:35:41
#include "base/memory/weak_ptr.h"
dsodman
2014/11/04 05:19:40
Done.
|
+ |
+namespace dbus { |
+class MethodCall; |
+class Response; |
+} |
+ |
+namespace chromeos { |
+ |
+// This class provides an api for external apps to notify |
+// chrome that it should release control of the display server. |
+// The main client is the console application. This can |
+// also be used by crouton to take over the display. |
+class ConsoleServiceProvider |
+ : public CrosDBusService::ServiceProviderInterface { |
+ public: |
+ ConsoleServiceProvider(); |
+ virtual ~ConsoleServiceProvider(); |
stevenjb
2014/11/03 16:35:42
~ConsoleServiceProvider() override;
dsodman
2014/11/04 05:19:40
Done.
|
+ |
+ void Start(scoped_refptr<dbus::ExportedObject> exported_object) override; |
stevenjb
2014/11/03 16:35:42
Comment above: // ServiceProviderInterface
dsodman
2014/11/04 05:19:40
Done.
|
+ |
+ private: |
+ // This method will get called when a external process calls the dbus |
+ // method LibCrosService.ActivateConsole. The method receives a boolean |
+ // value which is true when chrome is being asked to release control |
+ // of the display so that console can take over. It will be false |
+ // otherwise. |
+ void ActivateConsole(dbus::MethodCall* method_call, |
+ dbus::ExportedObject::ResponseSender response_sender); |
+ |
+ // This method is called when a dbus method is exported. If the export of the |
+ // method is successful, |success| will be true. It will be false |
+ // otherwise. |
+ void OnExported(const std::string& interface_name, |
+ const std::string& method_name, |
+ bool success); |
+ |
+ base::WeakPtrFactory<ConsoleServiceProvider> weak_ptr_factory_; |
stevenjb
2014/11/03 16:35:41
nit: blank line
dsodman
2014/11/04 05:19:40
Done.
|
+ DISALLOW_COPY_AND_ASSIGN(ConsoleServiceProvider); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_ |