image/decoders/icon/qt/gtkqticonsconverter.js

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 /* vim:set ts=2 sw=2 sts=2 cin et: */
     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 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
     9 function GtkQtIconsConverter() { };
    10 GtkQtIconsConverter.prototype = {
    11   classID:          Components.ID("{c0783c34-a831-40c6-8c03-98c9f74cca45}"),
    12   QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIGtkQtIconsConverter]),
    13   convert: function(icon) { return this._gtk_qt_icons_table[icon]; },
    14   _gtk_qt_icons_table: {
    15     'about':
    16     0,
    17     'add':
    18     0,
    19     'apply':
    20     44, /* QStyle::SP_DialogApplyButton */
    21     'cancel':
    22     39, /* QStyle::SP_DialogCancelButton */
    23     'clear':
    24     45, /* QStyle::SP_DialogResetButton  */
    25     'color-picker':
    26     0,
    27     'copy':
    28     0,
    29     'close':
    30     43, /* QStyle::SP_DialogCloseButton */
    31     'cut':
    32     0,
    33     'delete':
    34     0,
    35     'dialog-error':
    36     0,
    37     'dialog-info':
    38     0,
    39     'dialog-question':
    40     12, /* QStyle::SP_MessageBoxQuestion */
    41     'dialog-warning':
    42     10, /* QStyle::SP_MessageBoxWarning */
    43     'directory':
    44     37, /* QStyle::SP_DirIcon */
    45     'file':
    46     24, /* QStyle::SP_FileIcon */
    47     'find':
    48     0,
    49     'go-back-ltr':
    50     53, /* QStyle::SP_ArrowBack */
    51     'go-back-rtl':
    52     53, /* QStyle::SP_ArrowBack */
    53     'go-back':
    54     53, /* QStyle::SP_ArrowBack */
    55     'go-forward-ltr':
    56     54, /* QStyle::SP_ArrowForward */
    57     'go-forward-rtl':
    58     54, /* QStyle::SP_ArrowForward */
    59     'go-forward':
    60     54, /* QStyle::SP_ArrowForward */
    61     'go-up':
    62     49, /* QStyle::SP_ArrowUp */
    63     'goto-first':
    64     0,
    65     'goto-last':
    66     0,
    67     'help':
    68     7, /* QStyle::SP_TitleBarContextHelpButton */
    69     'home':
    70     55, /* QStyle::SP_DirHomeIcon */
    71     'info':
    72     9, /* QStyle::SP_MessageBoxInformation */
    73     'jump-to':
    74     0,
    75     'media-pause':
    76     0,
    77     'media-play':
    78     0,
    79     'network':
    80     20, /* QStyle::SP_DriveNetIcon */
    81     'no':
    82     48, /* QStyle::SP_DialogNoButton */
    83     'ok':
    84     38, /* QStyle::SP_DialogOkButton */
    85     'open':
    86     21, /* QStyle::SP_DirOpenIcon */
    87     'orientation-landscape':
    88     0,
    89     'orientation-portrait':
    90     0,
    91     'paste':
    92     0,
    93     'preferences':
    94     34, /* QStyle::SP_FileDialogContentsView */
    95     'print-preview':
    96     0,
    97     'print':
    98     0,
    99     'properties':
   100     0,
   101     'quit':
   102     0,
   103     'redo':
   104     0,
   105     'refresh':
   106     58, /* QStyle::SP_BrowserReload */
   107     'remove':
   108     0,
   109     'revert-to-saved':
   110     0,
   111     'save-as':
   112     42, /* QStyle::SP_DialogSaveButton */
   113     'save':
   114     42, /* QStyle::SP_DialogSaveButton */
   115     'select-all':
   116     0,
   117     'select-font':
   118     0,
   119     'stop':
   120     59, /* QStyle::SP_BrowserStop */
   121     'undelete':
   122     0,
   123     'undo':
   124     0,
   125     'yes':
   126     47, /* QStyle::SP_DialogYesButton */
   127     'zoom-100':
   128     0,
   129     'zoom-in':
   130     0,
   131     'zoom-out':
   132     0
   133   },
   134 }
   135 var components = [GtkQtIconsConverter];
   136 this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);

mercurial