widget/windows/nsColorPicker.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  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef nsColorPicker_h__
     8 #define nsColorPicker_h__
    10 #include <windows.h>
    11 #include <commdlg.h>
    13 #include "nsCOMPtr.h"
    14 #include "nsIColorPicker.h"
    15 #include "nsString.h"
    16 #include "nsThreadUtils.h"
    18 class nsIWidget;
    20 class AsyncColorChooser :
    21   public nsRunnable
    22 {
    23 public:
    24   AsyncColorChooser(const nsAString& aInitialColor,
    25                     nsIWidget* aParentWidget,
    26                     nsIColorPickerShownCallback* aCallback);
    27   NS_IMETHOD Run() MOZ_OVERRIDE;
    29 private:
    30   nsString mInitialColor;
    31   nsCOMPtr<nsIWidget> mParentWidget;
    32   nsCOMPtr<nsIColorPickerShownCallback> mCallback;
    33   nsString mColor;
    34 };
    36 class nsColorPicker :
    37   public nsIColorPicker
    38 {
    39 public:
    40   nsColorPicker();
    41   virtual ~nsColorPicker();
    43   NS_DECL_ISUPPORTS
    45   NS_IMETHOD Init(nsIDOMWindow* parent, const nsAString& title,
    46                   const nsAString& aInitialColor);
    47   NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback);
    49 protected:
    50   nsString mInitialColor;
    51   nsCOMPtr<nsIWidget> mParentWidget;
    52 };
    54 #endif // nsColorPicker_h__

mercurial