widget/cocoa/nsClipboard.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsClipboard_h_
     7 #define nsClipboard_h_
     9 #include "nsBaseClipboard.h"
    10 #include "nsXPIDLString.h"
    12 #import <Cocoa/Cocoa.h>
    14 class nsITransferable;
    16 class nsClipboard : public nsBaseClipboard
    17 {
    19 public:
    20   nsClipboard();
    21   virtual ~nsClipboard();
    23   // nsIClipboard  
    24   NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
    25                                     int32_t aWhichClipboard, bool *_retval);
    26   NS_IMETHOD SupportsFindClipboard(bool *_retval);
    28   // Helper methods, used also by nsDragService
    29   static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable);
    30   static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType);
    31   static NSString* WrapHtmlForSystemPasteboard(NSString* aString);
    32   static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard);
    34 protected:
    36   // impelement the native clipboard behavior
    37   NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
    38   NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
    40 private:
    41   int32_t mCachedClipboard;
    42   int32_t mChangeCount; // Set to the native change count after any modification of the clipboard.
    43 };
    45 #endif // nsClipboard_h_

mercurial