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

Side by Side Diff: components/mus/clipboard/clipboard_impl.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « components/mus/clipboard/BUILD.gn ('k') | components/mus/clipboard/clipboard_impl.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 2016 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 COMPONENTS_MUS_CLIPBOARD_CLIPBOARD_IMPL_H_
6 #define COMPONENTS_MUS_CLIPBOARD_CLIPBOARD_IMPL_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "base/macros.h"
13 #include "components/mus/public/interfaces/clipboard.mojom.h"
14 #include "mojo/public/cpp/bindings/binding_set.h"
15
16 namespace mus {
17 namespace clipboard {
18
19 // Stub clipboard implementation.
20 //
21 // Eventually, we'll actually want to interact with the system clipboard, but
22 // that's hard today because the system clipboard is asynchronous (on X11), the
23 // ui::Clipboard interface is synchronous (which is what we'd use), mojo is
24 // asynchronous across processes, and the WebClipboard interface is synchronous
25 // (which is at least tractable).
26 class ClipboardImpl : public mojom::Clipboard {
27 public:
28 // mojom::Clipboard exposes three possible clipboards.
29 static const int kNumClipboards = 3;
30
31 ClipboardImpl();
32 ~ClipboardImpl() override;
33
34 void AddBinding(mojom::ClipboardRequest request);
35
36 // mojom::Clipboard implementation.
37 void GetSequenceNumber(
38 mojom::Clipboard::Type clipboard_type,
39 const GetSequenceNumberCallback& callback) override;
40 void GetAvailableMimeTypes(
41 mojom::Clipboard::Type clipboard_types,
42 const GetAvailableMimeTypesCallback& callback) override;
43 void ReadClipboardData(mojom::Clipboard::Type clipboard_type,
44 const mojo::String& mime_type,
45 const ReadClipboardDataCallback& callback) override;
46 void WriteClipboardData(
47 mojom::Clipboard::Type clipboard_type,
48 mojo::Map<mojo::String, mojo::Array<uint8_t>> data,
49 const WriteClipboardDataCallback& callback) override;
50
51 private:
52 // Internal struct which stores the current state of the clipboard.
53 class ClipboardData;
54
55 // The current clipboard state. This is what is read from.
56 std::unique_ptr<ClipboardData> clipboard_state_[kNumClipboards];
57 mojo::BindingSet<mojom::Clipboard> bindings_;
58
59 DISALLOW_COPY_AND_ASSIGN(ClipboardImpl);
60 };
61
62 } // namespace clipboard
63 } // namespace mus
64
65 #endif // COMPONENTS_MUS_CLIPBOARD_CLIPBOARD_IMPL_H_
OLDNEW
« no previous file with comments | « components/mus/clipboard/BUILD.gn ('k') | components/mus/clipboard/clipboard_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698