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

Side by Side Diff: ui/base/clipboard/clipboard_android.h

Issue 658963003: Change Clipboard to use virtual methods for testing purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test rebase Created 6 years, 2 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 UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_
6 #define UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_
7
8 #include "ui/base/clipboard/clipboard.h"
9
10 #include <jni.h>
11
12 namespace ui {
13
14 bool RegisterClipboardAndroid(JNIEnv* env);
15
16 class ClipboardAndroid : public Clipboard {
17 public:
18 ClipboardAndroid();
19 ~ClipboardAndroid() override;
sky 2014/10/16 19:40:11 virtual and I don't believe we use override on des
dcheng 2014/10/16 21:51:39 The C++ style guide seems to be unambiguous on thi
20
21 // Clipboard public overrides:
sky 2014/10/16 19:40:11 You could actually move all of this to private as
dcheng 2014/10/16 21:51:39 Good point. Done. I've made everything private...
22 uint64 GetSequenceNumber(ClipboardType type) override;
sky 2014/10/16 19:40:11 virtual on all of these.
dcheng 2014/10/16 21:51:38 Style guide: "For clarity, use exactly one of over
23 bool IsFormatAvailable(const FormatType& format,
24 ClipboardType type) const override;
25 void Clear(ClipboardType type) override;
26 void ReadAvailableTypes(ClipboardType type,
27 std::vector<base::string16>* types,
28 bool* contains_filenames) const override;
29 void ReadText(ClipboardType type, base::string16* result) const override;
30 void ReadAsciiText(ClipboardType type, std::string* result) const override;
31 void ReadHTML(ClipboardType type,
32 base::string16* markup,
33 std::string* src_url,
34 uint32* fragment_start,
35 uint32* fragment_end) const override;
36 void ReadRTF(ClipboardType type, std::string* result) const override;
37 SkBitmap ReadImage(ClipboardType type) const override;
38 void ReadCustomData(ClipboardType clipboard_type,
39 const base::string16& type,
40 base::string16* result) const override;
41 void ReadBookmark(base::string16* title, std::string* url) const override;
42 void ReadData(const FormatType& format, std::string* result) const override;
43
44 protected:
45 // Clipboard protected overrides:
46 void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
47 void WriteText(const char* text_data, size_t text_len) override;
48 void WriteHTML(const char* markup_data,
49 size_t markup_len,
50 const char* url_data,
51 size_t url_len) override;
52 void WriteRTF(const char* rtf_data, size_t data_len) override;
53 void WriteBookmark(const char* title_data,
54 size_t title_len,
55 const char* url_data,
56 size_t url_len) override;
57 void WriteWebSmartPaste() override;
58 void WriteBitmap(const SkBitmap& bitmap) override;
59 void WriteData(const FormatType& format,
60 const char* data_data,
61 size_t data_len) override;
62
63 private:
64 DISALLOW_COPY_AND_ASSIGN(ClipboardAndroid);
65 };
66
67 } // namespace ui
68
69 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698