widget/gtk/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.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* vim:expandtab:shiftwidth=4:tabstop=4:
michael@0 3 */
michael@0 4 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 7
michael@0 8 #ifndef __nsClipboard_h_
michael@0 9 #define __nsClipboard_h_
michael@0 10
michael@0 11 #include "nsIClipboard.h"
michael@0 12 #include "nsClipboardPrivacyHandler.h"
michael@0 13 #include "nsAutoPtr.h"
michael@0 14 #include <gtk/gtk.h>
michael@0 15
michael@0 16 class nsClipboard : public nsIClipboard,
michael@0 17 public nsIObserver
michael@0 18 {
michael@0 19 public:
michael@0 20 nsClipboard();
michael@0 21 virtual ~nsClipboard();
michael@0 22
michael@0 23 NS_DECL_ISUPPORTS
michael@0 24
michael@0 25 NS_DECL_NSICLIPBOARD
michael@0 26 NS_DECL_NSIOBSERVER
michael@0 27
michael@0 28 // Make sure we are initialized, called from the factory
michael@0 29 // constructor
michael@0 30 nsresult Init (void);
michael@0 31
michael@0 32 // Someone requested the selection
michael@0 33 void SelectionGetEvent (GtkClipboard *aGtkClipboard,
michael@0 34 GtkSelectionData *aSelectionData);
michael@0 35 void SelectionClearEvent (GtkClipboard *aGtkClipboard);
michael@0 36
michael@0 37 private:
michael@0 38 // Utility methods
michael@0 39 static GdkAtom GetSelectionAtom (int32_t aWhichClipboard);
michael@0 40 static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard);
michael@0 41
michael@0 42 // Save global clipboard content to gtk
michael@0 43 nsresult Store (void);
michael@0 44
michael@0 45 // Get our hands on the correct transferable, given a specific
michael@0 46 // clipboard
michael@0 47 nsITransferable *GetTransferable (int32_t aWhichClipboard);
michael@0 48
michael@0 49 // Hang on to our owners and transferables so we can transfer data
michael@0 50 // when asked.
michael@0 51 nsCOMPtr<nsIClipboardOwner> mSelectionOwner;
michael@0 52 nsCOMPtr<nsIClipboardOwner> mGlobalOwner;
michael@0 53 nsCOMPtr<nsITransferable> mSelectionTransferable;
michael@0 54 nsCOMPtr<nsITransferable> mGlobalTransferable;
michael@0 55 nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler;
michael@0 56
michael@0 57 };
michael@0 58
michael@0 59 #endif /* __nsClipboard_h_ */

mercurial