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

Unified Diff: chrome/browser/chromeos/dbus/console_service_provider.h

Issue 697493002: Support transition between chrome and user mode console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/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..a4a3a17118b424c0ab61d6977556e3bf1c8bb70d
--- /dev/null
+++ b/chrome/browser/chromeos/dbus/console_service_provider.h
@@ -0,0 +1,63 @@
+// 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_
+
+#include <string>
+
+#include "base/bind.h"
Daniel Erat 2014/11/04 15:18:49 you probably don't need this include here, right?
dsodman 2014/11/04 16:35:04 Done.
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/dbus/cros_dbus_service.h"
+#include "dbus/exported_object.h"
+#include "dbus/message.h"
hashimoto 2014/11/04 08:57:44 nit: This include is not needed thanks to forward
dsodman 2014/11/04 16:35:04 Done.
+
+namespace dbus {
+class MethodCall;
+class Response;
Daniel Erat 2014/11/04 15:18:50 it doesn't look like this forward declaration is u
dsodman 2014/11/04 16:35:05 Done.
+}
+
+namespace chromeos {
+
+// This class provides an api for external apps to notify
Daniel Erat 2014/11/04 15:18:49 while we're providing comment nits: s/api/API/ on
dsodman 2014/11/04 16:35:05 Done.
+// chrome that it should release control of the display server.
+// The main client is the console application. This can
satorux1 2014/11/04 06:42:30 nit: three spaces -> one/two spaces?
dsodman 2014/11/04 16:35:05 Done.
+// also be used by crouton to take over the display.
+class ConsoleServiceProvider
+ : public CrosDBusService::ServiceProviderInterface {
+ public:
+ ConsoleServiceProvider();
+ ~ConsoleServiceProvider() override;
+
+ // CrosDBusService::ServiceProviderInterface overrides:
+ void Start(scoped_refptr<dbus::ExportedObject> exported_object) override;
+
+ private:
+ // This method will get called when a external process no longer needs
+ // control of the display and chrome can take ownership.
Daniel Erat 2014/11/04 15:18:50 nit: s/chrome/Chrome/
dsodman 2014/11/04 16:35:04 Done.
+ void TakeDisplayOwnership(
+ dbus::MethodCall* method_call,
+ dbus::ExportedObject::ResponseSender response_sender);
+
+ // This method will get called when a external process needs control of
+ // the display server and needs chrome to release ownership.
Daniel Erat 2014/11/04 15:18:50 nit: s/chrome/Chrome/, s/display server/display/ (
dsodman 2014/11/04 16:35:04 Done.
+ void ReleaseDisplayOwnership(
+ 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_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConsoleServiceProvider);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698