widget/windows/JumpListBuilder.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 __JumpListBuilder_h__
     7 #define __JumpListBuilder_h__
     9 #include <windows.h>
    11 #undef NTDDI_VERSION
    12 #define NTDDI_VERSION NTDDI_WIN7
    13 // Needed for various com interfaces
    14 #include <shobjidl.h>
    15 #undef LogSeverity // SetupAPI.h #defines this as DWORD
    17 #include "nsString.h"
    18 #include "nsIMutableArray.h"
    20 #include "nsIJumpListBuilder.h"
    21 #include "nsIJumpListItem.h"
    22 #include "JumpListItem.h"
    23 #include "nsIObserver.h"
    24 #include "mozilla/Attributes.h"
    26 namespace mozilla {
    27 namespace widget {
    29 class JumpListBuilder : public nsIJumpListBuilder, 
    30                         public nsIObserver
    31 {
    32 public:
    33   NS_DECL_ISUPPORTS
    34   NS_DECL_NSIJUMPLISTBUILDER
    35   NS_DECL_NSIOBSERVER
    37   JumpListBuilder();
    38   virtual ~JumpListBuilder();
    40 protected:
    41   static bool sBuildingList; 
    43 private:
    44   nsRefPtr<ICustomDestinationList> mJumpListMgr;
    45   uint32_t mMaxItems;
    46   bool mHasCommit;
    47   nsCOMPtr<nsIThread> mIOThread;
    49   bool IsSeparator(nsCOMPtr<nsIJumpListItem>& item);
    50   nsresult TransferIObjectArrayToIMutableArray(IObjectArray *objArray, nsIMutableArray *removedItems);
    51   nsresult RemoveIconCacheForItems(nsIMutableArray *removedItems);
    52   nsresult RemoveIconCacheForAllItems();
    54   friend class WinTaskbar;
    55 };
    57 } // namespace widget
    58 } // namespace mozilla
    60 #endif /* __JumpListBuilder_h__ */

mercurial