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

Side by Side Diff: components/clipboard/clipboard_standalone_impl.h

Issue 1685953002: mojo: Now that mandoline/ is deleted, also remove mojo:clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build. Created 4 years, 10 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
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 COMPONENTS_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
6 #define COMPONENTS_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/clipboard/public/interfaces/clipboard.mojom.h"
15 #include "mojo/public/cpp/bindings/strong_binding.h"
16
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 ClipboardStandaloneImpl : public mojo::Clipboard {
27 public:
28 // mojo::Clipboard exposes three possible clipboards.
29 static const int kNumClipboards = 3;
30
31 explicit ClipboardStandaloneImpl(
32 mojo::InterfaceRequest<mojo::Clipboard> request);
33 ~ClipboardStandaloneImpl() override;
34
35 // mojo::Clipboard implementation.
36 void GetSequenceNumber(
37 mojo::Clipboard::Type clipboard_type,
38 const mojo::Callback<void(uint64_t)>& callback) override;
39 void GetAvailableMimeTypes(
40 mojo::Clipboard::Type clipboard_types,
41 const mojo::Callback<void(mojo::Array<mojo::String>)>& callback) override;
42 void ReadMimeType(
43 mojo::Clipboard::Type clipboard_type,
44 const mojo::String& mime_type,
45 const mojo::Callback<void(mojo::Array<uint8_t>)>& callback) override;
46 void WriteClipboardData(
47 mojo::Clipboard::Type clipboard_type,
48 mojo::Map<mojo::String, mojo::Array<uint8_t>> data) override;
49
50 private:
51 uint64_t sequence_number_[kNumClipboards];
52
53 // Internal struct which stores the current state of the clipboard.
54 class ClipboardData;
55
56 // The current clipboard state. This is what is read from.
57 scoped_ptr<ClipboardData> clipboard_state_[kNumClipboards];
58 mojo::StrongBinding<mojo::Clipboard> binding_;
59
60 DISALLOW_COPY_AND_ASSIGN(ClipboardStandaloneImpl);
61 };
62
63 } // namespace clipboard
64
65 #endif // COMPONENTS_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
OLDNEW
« no previous file with comments | « components/clipboard/clipboard_apptest.cc ('k') | components/clipboard/clipboard_standalone_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698