| Index: ui/base/clipboard/clipboard.h
|
| diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
|
| index 94d78712f26c6c6e629b33513e43ffd1831224d1..87cf29cef82a4d28921e7a116e84d91a723a3067 100644
|
| --- a/ui/base/clipboard/clipboard.h
|
| +++ b/ui/base/clipboard/clipboard.h
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/compiler_specific.h"
|
| #include "base/gtest_prod_util.h"
|
| +#include "base/observer_list.h"
|
| #include "base/process.h"
|
| #include "base/shared_memory.h"
|
| #include "base/string16.h"
|
| @@ -132,6 +133,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
| CBF_BITMAP,
|
| CBF_SMBITMAP, // Bitmap from shared memory.
|
| CBF_DATA, // Arbitrary block of bytes.
|
| + CBF_INCOGNITO_MARKER, // Signifies that data came from Incognito mode.
|
| };
|
|
|
| // ObjectMap is a map from ObjectType to associated data.
|
| @@ -162,6 +164,8 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
| // size gfx::Size struct
|
| // CBF_DATA format char array
|
| // data byte array
|
| + // CBF_INCOGNITO_MARKER
|
| + // data byte array
|
| typedef std::vector<char> ObjectMapParam;
|
| typedef std::vector<ObjectMapParam> ObjectMapParams;
|
| typedef std::map<int /* ObjectType */, ObjectMapParams> ObjectMap;
|
| @@ -174,6 +178,22 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
| BUFFER_SELECTION,
|
| };
|
|
|
| + class ClipboardObserver {
|
| + public:
|
| + // Called at the end of Clipboard::WriteObjects()
|
| + virtual void OnWriteObjects(Buffer buffer) = 0;
|
| + protected:
|
| + virtual ~ClipboardObserver() {}
|
| + };
|
| +
|
| + void AddObserver(ClipboardObserver* obs) {
|
| + observer_list_.AddObserver(obs);
|
| + }
|
| +
|
| + void RemoveObserver(ClipboardObserver* obs) {
|
| + observer_list_.RemoveObserver(obs);
|
| + }
|
| +
|
| static bool IsValidBuffer(int32 buffer) {
|
| switch (buffer) {
|
| case BUFFER_STANDARD:
|
| @@ -280,6 +300,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
| // crbug.com/158399.
|
| static const FormatType& GetWebCustomDataFormatType();
|
| static const FormatType& GetPepperCustomDataFormatType();
|
| + static const FormatType& GetIncognitoMarkerFormatType();
|
|
|
| // Embeds a pointer to a SharedMemory object pointed to by |bitmap_handle|
|
| // belonging to |process| into a shared bitmap [CBF_SMBITMAP] slot in
|
| @@ -307,6 +328,8 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
|
|
| void DispatchObject(ObjectType type, const ObjectMapParams& params);
|
|
|
| + void WriteObjectsImpl(Buffer buffer, const ObjectMap& objects);
|
| +
|
| void WriteText(const char* text_data, size_t text_len);
|
|
|
| void WriteHTML(const char* markup_data,
|
| @@ -382,6 +405,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
|
| class AuraX11Details;
|
| scoped_ptr<AuraX11Details> aurax11_details_;
|
| #endif
|
| + ObserverList<ClipboardObserver> observer_list_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(Clipboard);
|
| };
|
|
|