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

Side by Side Diff: mojo/services/clipboard/clipboard_standalone_impl.h

Issue 687433002: Remove mojo/shell and (most) service implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove mojo/gles2, disable mojo apps in component build 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 | « mojo/services/clipboard/DEPS ('k') | mojo/services/clipboard/clipboard_standalone_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 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 MOJO_SERVICES_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
6 #define MOJO_SERVICES_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
7
8 #include <base/memory/scoped_ptr.h>
9 #include <string>
10
11 #include "mojo/services/public/interfaces/clipboard/clipboard.mojom.h"
12
13 namespace mojo {
14
15 // Stub clipboard implementation.
16 //
17 // Eventually, we'll actually want to interact with the system clipboard, but
18 // that's hard today because the system clipboard is asynchronous (on X11), the
19 // ui::Clipboard interface is synchronous (which is what we'd use), mojo is
20 // asynchronous across processes, and the WebClipboard interface is synchronous
21 // (which is at least tractable).
22 class ClipboardStandaloneImpl : public InterfaceImpl<mojo::Clipboard> {
23 public:
24 // mojo::Clipboard exposes three possible clipboards.
25 static const int kNumClipboards = 3;
26
27 ClipboardStandaloneImpl();
28 ~ClipboardStandaloneImpl() override;
29
30 // InterfaceImpl<mojo::Clipboard> implementation.
31 void GetSequenceNumber(
32 Clipboard::Type clipboard_type,
33 const mojo::Callback<void(uint64_t)>& callback) override;
34 void GetAvailableMimeTypes(
35 Clipboard::Type clipboard_types,
36 const mojo::Callback<void(mojo::Array<mojo::String>)>& callback) override;
37 void ReadMimeType(
38 Clipboard::Type clipboard_type,
39 const mojo::String& mime_type,
40 const mojo::Callback<void(mojo::Array<uint8_t>)>& callback) override;
41 void WriteClipboardData(
42 Clipboard::Type clipboard_type,
43 mojo::Map<mojo::String, mojo::Array<uint8_t>> data) override;
44
45 private:
46 uint64_t sequence_number_[kNumClipboards];
47
48 // Internal struct which stores the current state of the clipboard.
49 class ClipboardData;
50
51 // The current clipboard state. This is what is read from.
52 scoped_ptr<ClipboardData> clipboard_state_[kNumClipboards];
53
54 DISALLOW_COPY_AND_ASSIGN(ClipboardStandaloneImpl);
55 };
56
57 } // namespace mojo
58
59 #endif // MOJO_SERVICES_CLIPBOARD_CLIPBOARD_STANDALONE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/clipboard/DEPS ('k') | mojo/services/clipboard/clipboard_standalone_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698