Bug 749394 - Per-window private browsing theme changes for Windows and OS X; r=dao a=akeybl
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 07 Jan 2013 13:24:08 -0500
changeset 127038 222fa25433538017bda84fe743d6f6bdefcf1c96
parent 127037 090bc89ff6b41f264b10252c639fff781c019eb5
child 127039 1903a40f342d366c7b88e87741e510087f9da053
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, akeybl
bugs749394
milestone20.0a2
Bug 749394 - Per-window private browsing theme changes for Windows and OS X; r=dao a=akeybl
browser/base/content/browser.js
browser/themes/pinstripe/browser.css
browser/themes/pinstripe/jar.mn
browser/themes/pinstripe/privatebrowsing-mask.png
browser/themes/winstripe/browser.css
browser/themes/winstripe/jar.mn
browser/themes/winstripe/privatebrowsing-dark.png
browser/themes/winstripe/privatebrowsing-light.png
toolkit/content/LightweightThemeConsumer.jsm
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6920,28 +6920,35 @@ function getNavToolbox() gNavToolbox;
 # code is much more readable this way.
 let gPrivateBrowsingUI = {
   init: function PBUI_init() {
     // Do nothing for normal windows
     if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
       return;
     }
 
+#ifdef XP_MACOSX
+    if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
+      document.documentElement.setAttribute("drawintitlebar", true);
+    }
+#endif
+
     // Disable the Clear Recent History... menu item when in PB mode
     // temporary fix until bug 463607 is fixed
     document.getElementById("Tools:Sanitize").setAttribute("disabled", "true");
 
     // Adjust the window's title
     if (window.location.href == getBrowserURL()) {
       let docElement = document.documentElement;
       docElement.setAttribute("title",
         docElement.getAttribute("title_privatebrowsing"));
       docElement.setAttribute("titlemodifier",
         docElement.getAttribute("titlemodifier_privatebrowsing"));
-      docElement.setAttribute("privatebrowsingmode", "temporary");
+      docElement.setAttribute("privatebrowsingmode",
+        PrivateBrowsingUtils.permanentPrivateBrowsing ? "permanent" : "temporary");
       gBrowser.updateTitlebar();
     }
 
     if (gURLBar) {
       // Disable switch to tab autocompletion for private windows
       gURLBar.setAttribute("autocompletesearchparam", "");
     }
   }
--- a/browser/themes/pinstripe/browser.css
+++ b/browser/themes/pinstripe/browser.css
@@ -2387,17 +2387,17 @@ toolbarbutton.chevron > .toolbarbutton-m
   position: relative;
 }
 
 .tabbrowser-tab:-moz-lwtheme {
   color: inherit;
   text-shadow: inherit;
 }
 
-#navigator-toolbox[tabsontop="true"]:not(:-moz-lwtheme)::before {
+#main-window:not([privatebrowsingmode=temporary]) #navigator-toolbox[tabsontop="true"]:not(:-moz-lwtheme)::before {
   /* We want the titlebar to be unified, but we still want to be able
    * to give #TabsToolbar a background. So we can't set -moz-appearance:
    * toolbar on #TabsToolbar itself. Instead, we set it on a box of the
    * right size which is put underneath #TabsToolbar.
    */
   content: '';
   display: block;
   -moz-appearance: toolbar;
@@ -4156,8 +4156,32 @@ panel[type="arrow"][popupid="click-to-pl
 
 .center-item-warning-description {
   color: #828282;
 }
 
 .center-item-button {
   min-width: 0;
 }
+
+%ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
+#main-window[privatebrowsingmode=temporary] {
+  background-image: url("chrome://browser/skin/privatebrowsing-mask.png");
+  background-position: top right;
+  background-repeat: no-repeat;
+  background-color: -moz-mac-chrome-active;
+}
+
+@media (-moz-mac-lion-theme) {
+  #main-window[privatebrowsingmode=temporary] {
+    background-position: top right 40px;
+  }
+
+  #main-window[privatebrowsingmode=temporary]:-moz-locale-dir(rtl) {
+    background-position: top left 70px;
+  }
+}
+
+#main-window[privatebrowsingmode=temporary]:-moz-window-inactive {
+  background-color: -moz-mac-chrome-inactive;
+}
+%endif
+
--- a/browser/themes/pinstripe/jar.mn
+++ b/browser/themes/pinstripe/jar.mn
@@ -43,16 +43,17 @@ browser.jar:
   skin/classic/browser/panel-expander-open.png
   skin/classic/browser/panel-expander-open@2x.png
   skin/classic/browser/panel-plus-sign.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/page-livemarks@2x.png
   skin/classic/browser/pageInfo.css
   skin/classic/browser/Privacy-16.png
   skin/classic/browser/Privacy-48.png
+  skin/classic/browser/privatebrowsing-mask.png
   skin/classic/browser/reload-stop-go.png
   skin/classic/browser/reload-stop-go@2x.png
   skin/classic/browser/searchbar-dropmarker.png
   skin/classic/browser/searchbar-dropmarker@2x.png
   skin/classic/browser/searchbar.css
   skin/classic/browser/Search.png
   skin/classic/browser/Search@2x.png
   skin/classic/browser/Secure-Glyph.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..92f60e29f9fd71ed62101b7f7f22ea37423387a0
GIT binary patch
literal 1074
zc$@(;1kL-2P)<h;3K|Lk000e1NJLTq001Tc000yS1^@s6;g3%U000B|Nkl<Zc-qB}
z-%pcw7{xVNvLAoIl4%444X~-(j2g@wIAl{|7I(FnESb1nnPFTI#snP{iYY%Tr4)+3
zv;u9BQY}zdX$!=}mSPLCAVtJ>RX~^&5MjMEIr~0u;<9Y-7q12vAKq`z^E~GqHq3?R
zv&}MRd(&~pOIy}39Nz`j1zXlV=#O{5q%MDiBH0@Nyv<0_pYAjZ2VJln9$FWKG$)#K
zY)0xrov0Y`Mrdd{Q+=QV<}du~0%eB=r;bn;>h!AEMn;TszXjJa?n+`h<b@&K&G3j{
z-N8OIq;^C5=`A#-^@_UjP(SIU(Tv`I-?Xr=iOqTbluaF|%fE|ls@T^C<7fSn2&p}=
z7y3|>ZbidaHr!Hp5pvI9{^2s*x)Ic-b&CIWk7^KeV@u-9&UUoNx}eUm!cja(9$bIQ
zrVf(D6nk3Hoa&ZDonphda|#QOqF8wNC*}exc=p>1%-&nV+~_jAEdktN1tWoF%nmQn
zjCRD`g^4J}U6bU&^`~rZv5UJ6(0_7UlBzux^f!%S+PjG9fkiyMyND;A2z^Cu#{Zn4
zx2R3B*^KWw?TT7|^C)?6{VAJUtn|ZX2r0diRPHvTx7LsF?Fe+)o%ngL8o9~UD9gNp
z`yFBY-t$c4erFhpV|tu@zZ&QEso8Fac+*!mL>^p!%H|d;-l>CjuS1f`kIcA!p$`-G
z8MstFl%zJ|mmLD~l53#(_8P`*Perufw<9;HTAaxa2<TQ0&<(roB@eDYWpj&NNEV>^
z*e*%suIs2gYCzz|B*qv)=PUwUPcUo_V#E^0Nb6&am>y%)%Cz>NI19OEF=m|-Z>o;A
zkO$YFvbn_y617n6>XJmc(~82x%jhb(gCTtozAF>(H$K9kj={cuLLiu~6MxeVn+I`I
z?x9=q;QCWGw^;r*4U`{PIov>5k`ehk)Nm+#@M<2wqYA)N6Tm?I1GMIJqb<(`Z=I;a
z&7d7;xu0(6mOQxrl+7)cyR{Y-Nfs{UNo^?Fu18Ly5_KoqVJq_BrpyER5do)T%aI+c
zK=s!~*h{_QtUk-ab}!Kl-LC3Q+5BR$Dk!$Mt;)r1CKSi(@l#wa&csyU$CxUd+gcA<
z!d0eUMSh%ybdkI`HSN;PYkeu3TkOo1O2`uoC`&M{2HP>BB)$c*_$HB3_AX-@@k%dd
z(3^H&?`HsIOBEwFor;x5&&LRm#kHU$&afs>7G<7_kw>Wmb@@-R!puvKAKp_Se{&rQ
zwlpv<|IajtS(I7yWzDa=VsE{eU-`V?aFy%i=ECU7ch6%jpe)K<imYS+cvGqv@eU)M
s@eSj|8bMj<l>N^x^oPgBwSbrZ7l%*`5<vo2aR2}S07*qoM6N<$f`P3K_W%F@
--- a/browser/themes/winstripe/browser.css
+++ b/browser/themes/winstripe/browser.css
@@ -3372,8 +3372,25 @@ chatbox[minimized="true"] {
 
 .center-item-warning-description {
   color: #828282;
 }
 
 .center-item-button {
   min-width: 0;
 }
+
+%ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
+#main-window[privatebrowsingmode=temporary] #toolbar-menubar {
+  background-image: url("chrome://browser/skin/privatebrowsing-dark.png");
+  background-position: top right;
+  background-repeat: no-repeat;
+}
+
+#main-window[privatebrowsingmode=temporary] #toolbar-menubar:-moz-locale-dir(rtl) {
+  background-position: top left;
+}
+
+#main-window[privatebrowsingmode=temporary] #appmenu-button {
+  list-style-image: url("chrome://browser/skin/privatebrowsing-light.png");
+}
+%endif
+
--- a/browser/themes/winstripe/jar.mn
+++ b/browser/themes/winstripe/jar.mn
@@ -39,16 +39,18 @@ browser.jar:
         skin/classic/browser/menu-forward.png
         skin/classic/browser/monitor.png
         skin/classic/browser/monitor_16-10.png
         skin/classic/browser/pageInfo.css
         skin/classic/browser/pageInfo.png
         skin/classic/browser/page-livemarks.png                      (feeds/feedIcon16.png)
         skin/classic/browser/Privacy-16.png
         skin/classic/browser/Privacy-48.png
+        skin/classic/browser/privatebrowsing-light.png
+        skin/classic/browser/privatebrowsing-dark.png
         skin/classic/browser/reload-stop-go.png
         skin/classic/browser/searchbar.css
         skin/classic/browser/searchbar-dropdown-arrow.png
         skin/classic/browser/Secure24.png
         skin/classic/browser/setDesktopBackground.css
         skin/classic/browser/click-to-play-warning-stripes.png
         skin/classic/browser/Toolbar.png
         skin/classic/browser/Toolbar-inverted.png
@@ -261,16 +263,18 @@ browser.jar:
         skin/classic/aero/browser/menu-forward.png                   (menu-forward-aero.png)
         skin/classic/aero/browser/monitor.png
         skin/classic/aero/browser/monitor_16-10.png
         skin/classic/aero/browser/pageInfo.css
         skin/classic/aero/browser/pageInfo.png                       (pageInfo-aero.png)
         skin/classic/aero/browser/page-livemarks.png                 (feeds/feedIcon16-aero.png)
         skin/classic/aero/browser/Privacy-16.png                     (Privacy-16-aero.png)
         skin/classic/aero/browser/Privacy-48.png                     (Privacy-48-aero.png)
+        skin/classic/aero/browser/privatebrowsing-light.png
+        skin/classic/aero/browser/privatebrowsing-dark.png
         skin/classic/aero/browser/reload-stop-go.png
         skin/classic/aero/browser/searchbar.css
         skin/classic/aero/browser/searchbar-dropdown-arrow.png       (searchbar-dropdown-arrow-aero.png)
         skin/classic/aero/browser/Secure24.png                       (Secure24-aero.png)
         skin/classic/aero/browser/setDesktopBackground.css
         skin/classic/aero/browser/click-to-play-warning-stripes.png
         skin/classic/aero/browser/Toolbar.png
         skin/classic/aero/browser/Toolbar-inverted.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9eaf3aec7e71bd4d7f3e3d91b47fa3717a17a947
GIT binary patch
literal 1355
zc$@)C1+@B!P)<h;3K|Lk000e1NJLTq000^Q000;W1^@s6<bv(R000FNNkl<Zc-rlj
zTTGK@7{{4{4#uo&DJ{nyILX06!KoAmmV#165Tu17P?*ReD!2i22WQxbY|5M*i+BQ5
zP$^K<Q3rycPDG{`o7ogWG+WH>+)Q@0E&lhs&DR^3-7d?ri(lUFd;b6D`R9G}w)q?Y
z{3HAagBC9FTtF;jYgu581A}{aCSD`l2_dnBaD2hzO1Lo(=XK`hG2K4fk*(~-WwWeI
z&zX6wK`aQDr%Ja~=lfSr6bJ74m3Wrpx2t!VC@z@v#l#|!K;f&G?`SIuc>f90nKxBh
zR3+qx$+%D+AtFyc%V0rnh5ql%<oi|L$&{5HGsw#?6a~EZtbTnL21;&V@`FdjJdR{r
zK)!joaCL-$9}-~ntGZ*-_hI7Q8K&F3_1aEQ?^BvFpp$LyDDbcT?oI#Q^K26=$b*E*
zi`7#&th3-$-UzN$&*FN;V~iEdVOT$dVciU_md>L!-HdE``8B<4`%qKbSzO=w2qW1K
zFq}1mvBEigMLiQ$574z`7)SJju<o8lj=bVFW!TP9lrAZ@c4S*IUOI=dqFG$tdLO4U
zM{#)Ld7RE1$E7Xb!>YfBk=*+@Z5Ts`&Wg*%2e_1V&!%<jCT!l5)HAx3LbuK0O35rb
z4VRE1Eg7K<F$;1}@hv#lvdN6TtSRi*bRkdv*6$gT;@edJGE-Xm4ZZ)-lx)U@&3A2F
z)UowjG;907H1gbKUh4Up_3qbn!mPiEwhRk4`W6n_kIpUGC%3yXtp{6V<<He#x>FLj
z6$Yv+iBKZaPZ+&bCoTQKq_v=T?KI92>{%}@`^jIZ+D4uz&a3owi_+7K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O$
zTWC^o9LN28J09(5Ii+wms<qTLm{t!hXk8z+K@f{otjj|eHwZ@cu*}%r>LrM%aF_Pf
zOZC)(Vz6XeTWPL2%xlwRT}XRLk0F>L+V2PFfJi<BK78Q(F5eI5|39LjR4UaJL4!(2
zID~)*kN^}Q=b*TrxJqAyaCsuYf*Ue`8dwkLfi1vhpdQcy8bF6V4n6L2871csp-@`S
z2-SX{_eyu?{yp}qmrl6fydGiM^irWvSY3&Pp0@8W?lm`VX!CjBPyET}<2Z9I%sB=J
z`g%@xckK)LeKs8<)SwH6GOdC%rcysWa0iKh5sQADiiCsDtIZ+12#zLj(I}MH(Zn2!
zuFUfb#bWV$KA-<uO#riR<uzm%(19)#(pdPGy)!tR7$2Q%Z8qFgNQwPy?@32Gm5T8}
zc>dIX@%%VLiEdb0Ot&76jZ9)c;QuhEriq1rLkf!K*%{|EZa9DJNXKQ3oE%>(Bj@hk
zx&4S2jymo?#vaa&b{!sA_Abq0AG7E{7YfBtY#O?LZK(VhzjL{0Cc_4Dx!h{mQNR4k
zWP&&=-yOEwhS7m86bj+Ub&Ql82nPHvT=*X%;gAQihtPp86cYGCl!_uvZM!ViWFir+
z47puz-HV=gp344@WHPdQr@2o_k!|SUf7l3tyJ6NyiMhqF)jIX^#dL;c;~<aNZG&TS
z3Aq4R9S`n3Vbke&Hk<wId^PQC-EQp13}*4|(1kJ{p-M)S5H!+a(jgO*Q$P>Y?GQ2m
zCR#!cLa!G%13R5CGhv38RSFRT3o=;LLO>4!9f(wL;S%Ue6%w)zdK-ZT++ip}W2W3u
e>wlZt3;zO0QFaOylzPno0000<MNUMnLSTZXFgdXR
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -4,22 +4,29 @@
 
 this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"];
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
   "resource://gre/modules/LightweightThemeImageOptimizer.jsm");
 
+XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
+  "resource://gre/modules/PrivateBrowsingUtils.jsm");
+
 this.LightweightThemeConsumer =
  function LightweightThemeConsumer(aDocument) {
   this._doc = aDocument;
   this._win = aDocument.defaultView;
   this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter");
 
+  if (PrivateBrowsingUtils.isWindowPrivate(this._win)) {
+    return;
+  }
+
   let screen = this._win.screen;
   this._lastScreenWidth = screen.width;
   this._lastScreenHeight = screen.height;
 
   Components.classes["@mozilla.org/observer-service;1"]
             .getService(Components.interfaces.nsIObserverService)
             .addObserver(this, "lightweight-theme-styling-update", false);