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

Side by Side 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: fixed 2 mistakes in previous patch 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 unified diff | Download patch
« no previous file with comments | « DEPS ('k') | chrome/browser/chromeos/dbus/console_service_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_
7
8 #include <string>
9
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h"
12 #include "dbus/exported_object.h"
13
14 namespace chromeos {
15
16 // This class provides an API for external apps to notify
17 // chrome that it should release control of the display server.
18 // The main client is the console application. This can
19 // also be used by crouton to take over the display.
20 class ConsoleServiceProvider
21 : public CrosDBusService::ServiceProviderInterface {
22 public:
23 ConsoleServiceProvider();
24 ~ConsoleServiceProvider() override;
25
26 // CrosDBusService::ServiceProviderInterface overrides:
27 void Start(scoped_refptr<dbus::ExportedObject> exported_object) override;
28
29 private:
30 // This method will get called when a external process no longer needs
31 // control of the display and Chrome can take ownership.
32 void TakeDisplayOwnership(
33 dbus::MethodCall* method_call,
34 dbus::ExportedObject::ResponseSender response_sender);
35
36 // This method will get called when a external process needs control of
37 // the display and needs Chrome to release ownership.
38 void ReleaseDisplayOwnership(
39 dbus::MethodCall* method_call,
40 dbus::ExportedObject::ResponseSender response_sender);
41
42 // This method is called when a dbus method is exported. If the export of the
43 // method is successful, |success| will be true. It will be false
44 // otherwise.
45 void OnExported(const std::string& interface_name,
46 const std::string& method_name,
47 bool success);
48
49 base::WeakPtrFactory<ConsoleServiceProvider> weak_ptr_factory_;
50
51 DISALLOW_COPY_AND_ASSIGN(ConsoleServiceProvider);
52 };
53
54 } // namespace chromeos
55
56 #endif // CHROME_BROWSER_CHROMEOS_DBUS_CONSOLE_SERVICE_PROVIDER_H_
OLDNEW
« no previous file with comments | « DEPS ('k') | chrome/browser/chromeos/dbus/console_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698