From 14af0c83746c37216a518935c95342eb13a3625a Mon Sep 17 00:00:00 2001 From: "pkotwicz@chromium.org" Date: Fri, 22 Nov 2013 19:01:47 +0000 Subject: [PATCH] Use the regular window header for maximized v1 apps BUG=321799 TEST=Manual, see bug Review URL: https://codereview.chromium.org/77733011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236802 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/resources/ash_resources.grd | 9 - .../common/window_close_fullscreen_hover.png | Bin 544 -> 0 bytes .../common/window_close_fullscreen_normal.png | Bin 503 -> 0 bytes .../window_close_fullscreen_pressed.png | Bin 631 -> 0 bytes .../common/window_fullscreen_shadow.png | Bin 349 -> 0 bytes .../common/window_fullscreen_shadow_rtl.png | Bin 922 -> 0 bytes .../common/window_size_fullscreen_hover.png | Bin 475 -> 0 bytes .../common/window_size_fullscreen_normal.png | Bin 456 -> 0 bytes .../common/window_size_fullscreen_pressed.png | Bin 630 -> 0 bytes .../common/window_close_fullscreen_hover.png | Bin 1244 -> 0 bytes .../common/window_close_fullscreen_normal.png | Bin 1187 -> 0 bytes .../window_close_fullscreen_pressed.png | Bin 1286 -> 0 bytes .../common/window_fullscreen_shadow.png | Bin 834 -> 0 bytes .../common/window_size_fullscreen_hover.png | Bin 808 -> 0 bytes .../common/window_size_fullscreen_normal.png | Bin 735 -> 0 bytes .../common/window_size_fullscreen_pressed.png | Bin 1083 -> 0 bytes .../frame_caption_button_container_view.cc | 27 +- .../frame_caption_button_container_view.h | 5 +- ..._caption_button_container_view_unittest.cc | 36 --- .../ash/accelerator_commands_browsertest.cc | 26 +- .../frame/app_non_client_frame_view_ash.cc | 236 ------------------ .../frame/app_non_client_frame_view_ash.h | 70 ------ ...p_non_client_frame_view_ash_browsertest.cc | 229 ----------------- .../ui/views/frame/browser_frame_ash.cc | 101 +------- .../ui/views/frame/browser_frame_ash.h | 3 - ...wser_non_client_frame_view_factory_aura.cc | 8 - chrome/chrome_browser_ui.gypi | 2 - chrome/chrome_tests.gypi | 1 - .../desktop_root_window_host_win.cc | 2 +- .../desktop_root_window_host_x11.cc | 2 +- ui/views/widget/native_widget_win.cc | 2 +- ui/views/window/non_client_view.cc | 8 +- ui/views/window/non_client_view.h | 5 +- 33 files changed, 23 insertions(+), 749 deletions(-) delete mode 100644 ash/resources/default_100_percent/common/window_close_fullscreen_hover.png delete mode 100644 ash/resources/default_100_percent/common/window_close_fullscreen_normal.png delete mode 100644 ash/resources/default_100_percent/common/window_close_fullscreen_pressed.png delete mode 100644 ash/resources/default_100_percent/common/window_fullscreen_shadow.png delete mode 100644 ash/resources/default_100_percent/common/window_fullscreen_shadow_rtl.png delete mode 100644 ash/resources/default_100_percent/common/window_size_fullscreen_hover.png delete mode 100644 ash/resources/default_100_percent/common/window_size_fullscreen_normal.png delete mode 100644 ash/resources/default_100_percent/common/window_size_fullscreen_pressed.png delete mode 100644 ash/resources/default_200_percent/common/window_close_fullscreen_hover.png delete mode 100644 ash/resources/default_200_percent/common/window_close_fullscreen_normal.png delete mode 100644 ash/resources/default_200_percent/common/window_close_fullscreen_pressed.png delete mode 100644 ash/resources/default_200_percent/common/window_fullscreen_shadow.png delete mode 100644 ash/resources/default_200_percent/common/window_size_fullscreen_hover.png delete mode 100644 ash/resources/default_200_percent/common/window_size_fullscreen_normal.png delete mode 100644 ash/resources/default_200_percent/common/window_size_fullscreen_pressed.png delete mode 100644 chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc delete mode 100644 chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h delete mode 100644 chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd index de1cd9b0bebcf4..5447785b74e963 100644 --- a/ash/resources/ash_resources.grd +++ b/ash/resources/ash_resources.grd @@ -204,15 +204,6 @@ - - - - - - - - - diff --git a/ash/resources/default_100_percent/common/window_close_fullscreen_hover.png b/ash/resources/default_100_percent/common/window_close_fullscreen_hover.png deleted file mode 100644 index bd6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vJHxFiRY%(%$>H+KU0an5}OU>IC*@)2CYm2$zS;1t9~$b>J?!*r(0aWq3S zhST6be9Gcv-vA5XRTkn1Cr09oe#PJjxda;k5u>HVSe)^17#wkqV?+^T=NUwh_!MW- z#NY@y#PSqEuL&Xs5hOmxnZn=*ImC)6I|mVigl-vWbPGA6vd{=ZR1Y?lFuU`nO+VA# zolhuikZK|*Q%}OM>t?;;Bx%;!bwW{11ieWhK0jE`WXwdHER_C=;ap<127710#Rces=9X#?NDt?|J1g2c-N@997>xb z$bA6{ysOorBc(fZbhR3IgQ0hWpq)AKUi*U)?|0^2g!;|Vc8xvC9rZZ;r5?*2_PAZk z&k;fI!7X03tyv+G&yYFA=;YlvuZxT82Cl|s4*iviRbcZZ-wup-imxG zo(oTnncO}isCZ|0mssy&nRfQYGV67hvOAlg4=~;DtaTQjpS8|n@mV9N{OO+t_=r&H z`{+ACrEW-s#t|xWXA@K@^%Wr~*2;g^egI5B06q_R6u}pKF&BIa9wmJ<_zyUE1d(;b R{jUH3002ovPDHLkV1lLpB*Fjy diff --git a/ash/resources/default_100_percent/common/window_fullscreen_shadow.png b/ash/resources/default_100_percent/common/window_fullscreen_shadow.png deleted file mode 100644 index 8a6e37f3543b5b19867409a073412c14fde7b8e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)TkT>AbR*go>0 zwOWDOz>r#J2d&jVbBBeXK_?}U54TUa$2yKC`!vYjtqgO#ylc=#6aM&~%joO_+_|UQ vDL?M~)IZ(RIJt3`%F`i37w-DqUHJh&tCu_xA?WI;00000NkvXXu0mjfG`FG1 diff --git a/ash/resources/default_100_percent/common/window_fullscreen_shadow_rtl.png b/ash/resources/default_100_percent/common/window_fullscreen_shadow_rtl.png deleted file mode 100644 index 6439bdc4dbd69c03578ebf3b1d94ac3b8b94ccac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 922 zcmV;L17-Y)P)%rSYiRiih$$p0MUCKihtxj$sFMy=fb8EQZPL~hGa#A4K5#!YKbgL-buKv1lT zHC%SLh#=Njdv_TIYt*Qyk?TLhqK4~3wjdZq^)PN}A=OyqFs?xX#Co~wZcAuX%INJO zL!m16@Qd@I*)CC0JlK=%e)y5!HPRM>+JD>i)BnofcFZkBju?ibSE|XjleJ|V`OSaw zo2hB*281}ErZ+G!ZYY=KN1ZDR(Y9skQt8$&|BbTcn1HZTmJM$FLv|?TefaT5h(-9s0^JvFNWl)&#xlU$N>P+0hgEK1 z-99=hRk#7n(Gu_e8(1JWN&vF~7>PfF_OlrJkYLC3%W@+h-|;7o=ZdtPDqB}Gfa~9E zGB~?6mHXKo zI?Mo9H~!+l0S5lbmI^%9E}U1r@W!$;3BD5kmgKbMO4SKPS=Lnp>+RhK3xXohRtSI- z!c)LA6JaZDAuA+;4-#8L?r8o5R;#>a^++}ucqMr1KGR2eAp!dc^ox8mRN2^)}*-Ou(b1lGQT)Rp<1U2}urKO+T? zGmCM|BQer0qzTD(vi4=$9;}It!PWP5>&qSWMJjV!t8uV#=K=x9ACz>zfX(zEFdoUjVYQ;IS wSDt21x{=5h60VU&>{_3xq&_F^7w#ACe`aY?OCN%$aR2}S07*qoM6N<$f=o`lY5)KL diff --git a/ash/resources/default_100_percent/common/window_size_fullscreen_hover.png b/ash/resources/default_100_percent/common/window_size_fullscreen_hover.png deleted file mode 100644 index a85c2b7883165ace9725e3ebc3c6d21cf543f35e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 475 zcmV<10VMv3P)r0004^Nkl6wcN1A>AW2!d;%FJRych@nqvCin!Rfor(IMrH~tEGRPW_9>I0X!>+u z!Hq6_oa%pjed0Ik1arhX2VU-Z&zA}qGKLIQ@D=RQl8KQ6bYg{oFlBgO8Dhi?fe>-R zCdv~PCI-%b(FtLq($K^-V@ANGvQRSQn4yi7nIveWkqQxGHSTbKxobZ;5(M&Bpb=}F zJ%0@m43XgC0~h3ote|m`65}3$)%fbBYYk zx%A0-mS+ku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<$U52tsx7deSY9V#(d={)g5I+U3XTCuknVRDm6-=d%5uL0DG*0MK_{SPPoU{~ zC3PrOXKGSas-_NW*Fo|Mde;kxv~rg}kZMNw1E#xC@(Q}@zK1qSgmWm>rF!X6>5={! zC8YJDw;sCc_9`Q{!RJv;kVU1?=y&>^LPL-RIjS+;TLmvy*^;~a&|02(9?^J(S8{{{ zX}!I34PJ@K5pA-&nsa|2T5@xzCXdi=NaN&~!AXHclF~_>%*i2b@~o0|d#7G>{wyN{ zMwit%l~Xg#-cOJO@gm87JJaOUu);nLoULTsJ~uqzT|Wsiu}fCtjem1=F2w3&GQgkdD&iQuxe0Y9!Gw4GY^%VPK-Sz z-wdkp=8HDWkDC}_{skcgRnlFmn~AaLbf$)PUOidUdM%jyrub#l$Zf5F& zgIx!bpa!#6yAHSvHRL$lb>#iFFU$FD=bH7~-ahNM(~peb&WF-|J3&kP?Tj(yw^P`p z-_EI%emlue`0ZWCg5TZ-E%@zyS=>Kw6cOZ?{0%;zE<&E*$w2@B002ovPDHLkV1nYD BHg*62 diff --git a/ash/resources/default_200_percent/common/window_close_fullscreen_pressed.png b/ash/resources/default_200_percent/common/window_close_fullscreen_pressed.png deleted file mode 100644 index 5c2ad3feb9d604d2d818fd1de67945bbbba37360..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1286 zcmV+h1^N1kP);Yj8{Xh{5ZKAXw~HO%%1oI8s$9y)Fuhk{EG=dJ_fP4}b}u z#r7^HQ2^WI6`Eco50DGkK2LX8t&VqqsXdl!{ugL{Vf}Q@+1c4K$MtYB7r7=;PU}EM zIj)-%fYER!xkwul#h@=a&UUpJH0Gw2ZvhZ9gBDg$H-K0u;&owRv4cp8GERnMwG{*y zpnUELumII25MaEJFX}_U0M#g{r%{lnG9F6zM1AU5M5S0jbPixVkUmf9V1NP=JBZE! zi2pVjfKf^8AmBi4fD#}BET|JfVg`{MsEtbrMVy2$<6gNes1reI4Rn>`U;r}W24EO< z1Bnjm#UOfp+}VLv0R|(+ChLP)fP&V!vxMxhf}mYQbsUUK8TZ6txhQXyplvOIpk2V} zy?5(l&jJQSrpP#~uYSJuvHKp7plx(eKY(cMB01<2e}c~Y79vylFXjecT%vjx&^bCr zpMXTRjTuC8aI3`kLP^{Z3+TLm0W+qfZX8s<%@Gd74ZbA)6^@W3I%t3f5^n$%{|Ib| zc`1)cf#h^_#?2+lZ*#2Vb4P%V}(e5=3K=k<`IAfDbbCvaAUfPsjNhNdJjG_I%Ucq|?pPT3q&-jTP1TW9ObdSnWN zoEi~LV*W;G4wI`Q(i?`&mvZw5+J7<~a@#&}ox~6GV&>#V#PLSI$%$c!4y0(%y z%c{G|e%GJ!Yx%XZuk5S4wQM>*tIb3)$!!{Cir7KnYe4bXs!a;*cO5uU_s+5_30)&W z;f6thRzcsz9z61wl|olRvEwh_e-w|k0t&VY3O_`a{8lMCk>4U~_+eup9|gobL&KPJ ztdx{eun;WZ|MD@iLMiGD(Lt@;WuX+Zq+{7oj9{^rtL1`4*^mv%CaEdbyG&(Yhk}d9 z5|3q5HUlIcD~W1uuqc_L zDV!jyKgqIEhuEHF{YmtXa4H^(hl2)Qcid-LI$q2AOZaoXf~>w|^Uty&mZyEM&EYFT zSuFdFYWBIk3__mGSF?UYC<|r2imaaGO;39t1=RF@NctO9gd^d|Z&tET=gIxh6TOlh zFoh$&jH=T6X7@wGEIYV!Z07*qoM6N<$f^1A!&j0`b diff --git a/ash/resources/default_200_percent/common/window_fullscreen_shadow.png b/ash/resources/default_200_percent/common/window_fullscreen_shadow.png deleted file mode 100644 index 9c41fc0acca510d391cb344cfa00752c5fb3f911..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 834 zcmV-I1HJr-P)Vw=6a>)vvuk6BAmISqg-dV%5-z~qI0QE^1SBRQ1T1zwTC0MuDY-T7Z3(HVYIW1RHyX{25gXT^Vmepe?ie>VZ^#)D z|3Xvb@oT|f3mD&A!6+$oiQ$9 zg%^ZfJDY1JUZ<$J;%-r$iq$DPd$!eaB=>@(it3x1(1#!Uc$l$7WjL=`2z5v%zgKlbG*HGJZXrSs&&guyl7K;@t37;3RDB#U*JaW_wrs!2t_SNCaV5ZS8#B zt*m^@#KPrqPj7WOkT>uXF8~CaoRt-r7&rCRqquG4ZGPbT++A{>$XQ=Z-dx`Lf+rFh zT2z{P$;NYym$<b-`$^8b= z5_0^vzs5DLV_f4p#x<^S9pf6;xQ=m+Yh1^;#x<^ET;m$oF|Ki)zs2c~$L|g{?f?J) M07*qoM6N<$g1&H)XaE2J diff --git a/ash/resources/default_200_percent/common/window_size_fullscreen_hover.png b/ash/resources/default_200_percent/common/window_size_fullscreen_hover.png deleted file mode 100644 index 1c466bd83e27510cb65c231cc1e36433452fa3ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 808 zcmV+@1K0eCP)3v}iRPX_48%+WukeETWSJ))vwtXe zDtZME`q9DusH(2+Ir>N4oOn=mtUvYbhHxHNoj||p;|QP@-~s6V3i6QBhXyRKpaG`g z87%Jwd596#4zJvx<{4@MA(7}ahAtx|Lwh(1g&86Zq+!X(Ax7AB7${#zJ!r(?nh}OT znq-I^U}W*O2pL$}}6#c}njl&OttWG6^qonU(Q;RHBbBc=5(VOQBf zg%k>M)Pn#)90W|{3M_>IaCYpOpHfM3eR|lxik^Qj*~t!a)C58OZNAdpY#N<|@x@ue zj9HcZAwvif^7EGKzZZxtdjl0tUDMP{T^{lQGl`R0i%MYtFuz<`MyGLE+A4?P=1k3+ zTI5t&lFtStuTp2KlXV%BAD4gVH)7GgAN$P8mo<1%|f9de%cdNn2imppG*Kk;Gzg zml$&9AWkKgs=q$TnS)3QK%fE8aOO?jyq|;V3gf+>L5Hdtii8P<8TwiG>i1q0SYrw^ m^uAu!qf*U7V9esqY4I0AUcvL^*Q9R%00002? z9%eq_EAWiR836`8$o!WHF=F3NXdjY1{mXp_fba(H0rN)Y3(LCNYUUDYA> zH320}Cnsb?vZfR|t@A*Pm7x8co(7-^CsA;X-I>T~PO6oJI7%rgN!l#6F~La`hUu7u z392P1#{dS%98Y9nnqh0DHV5YL#fI6mkIo2y%-!8OoDJT5c_L6O0sx5|NPjq;qTJyY zLGFuT$*BXX2_Pk)*cpbzZQD$UpjZ@Me*%G(Bl_^(33>Jt%DSKmDB_!I9^XTP@Yx9k zg3#K38J&(-*4%8TRMpfvgqed;`@4M=fdEF3Pz|cQS89*bU~vj!u?ZYJtgV;YIdoQ4 z=5qiE1XxXUyL9a1T8B7DtNMpiXEkg8g%x!aAZP=m6EZAd?7+cN?ZmgCM8@ zRB+Zy?L?A9P@|2&8F8A9))I2iJ(Uti-@4AI5ojhFD}P=ADZX9lTj5C%*aUV=FtiHF zQ9}`^ANcFMyMc;C_Bw>Yd6Nyrw>Lj6`q~5l@n~k4c?+AXQ87(L2_Tz}l+IG#Dv$PG zHprM?-@&^hBC|!E6KiuX6BuWPTW+c*nQ{j*SDU5IGsEEcXO8+ZCSc2;e3?SXlpq_V zNXpn%(Ck!hZg3DF^R^PoQ+d*q9r7|~_gprAp^_wxQwq#xsp&PQWJu}}uB2fHbFk&fiSAmQ&Ym(FDAdepH_c9Yso!?E2swW&_ R?W6zz002ovPDHLkV1mnsO%(tD diff --git a/ash/resources/default_200_percent/common/window_size_fullscreen_pressed.png b/ash/resources/default_200_percent/common/window_size_fullscreen_pressed.png deleted file mode 100644 index ca097161b8be042c651bad717f6d0dd106305951..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1083 zcmV-B1jPG^P)rUHB5Ww+G>|HOFP?0JjRY;YPDgqdXKuSvpJ-xnHOTTixBwUm5Ooa0&J?C?0z4EZ` z#M^PBTGd|&B}n0?*|nWGLUhE2SpO?(iUceGN<=(e0Vbv?v7l|SB9?xqu;Hux>v=$Y zN;I($s{lkPPnO*%s}yLHfH)WmnKe-uqW%boVrHG@a*rsA59;thIZTGYo~@YhF|u6L zbRf#17+~1uvFsU&G9(^o2SH2@VvzBCH49;g;*b#36m0}CI0R!63%M+eppe7_@i~Y= z%8S?yS%@MeE{M+o3{nars6OwNqC1TwVvK$w5AffTs2h*PEU+CeRTl&l%fFRgS zg)<5$sObgK`7Er;LwTqU%@&T6BxynIX1lqSs|~dheWZ_~qvbUu(HZeU^!P&1k%C-~ zA-q|4vnYLRij$0#13}KB5zwv=oF@WH=VnN$a-kZ;R3=`Xo955S>x+qOC() zg`j8>=tMzzj-j|&(#)xblEji&i&h@A7z5{2ow^{)d7Fi#nKONcAY3#a=xq_m-9h$J zACG2slyC1!bI%8>Wl|puV;sm{EQg zxu9BE&@5!;gP@-3MSTJSP8NbLbYJ%^X!)mY4X^42{o@18voJY{-M-Zeh zO_M=$zW}`xtLzC~s7rOpnUKCRm7Y*byg?9a4_&G&b;a33`r7o%J=E}kSV!5FiF1_c z8+{#JGmkO~;+}`(jfry}if&E(^ALiz`5>54cq4D+E$2)f4WL{9nK~#33MYYpBL|#o zSu|7wHSk}{>II7NAWK5fD7-UCOic>^>U&RJD+GNqAl{6E z5hY2A!HPe11O`Asn_>q+oX=(VU&he=*KyjzV|y4rH-;PznU5D#=_gluz*A7QpX~#f zj~^6QdiR5JD5%Q&Lv;$Fpz7|R!S3OJs=CJ*Ajb##EaFP;!qUZ}ptk5*PzCp?$zstq z5cH?-&c_NBIgX-lk diff --git a/ash/wm/caption_buttons/frame_caption_button_container_view.cc b/ash/wm/caption_buttons/frame_caption_button_container_view.cc index 320ab953663ccc..40708b86c74092 100644 --- a/ash/wm/caption_buttons/frame_caption_button_container_view.cc +++ b/ash/wm/caption_buttons/frame_caption_button_container_view.cc @@ -124,9 +124,7 @@ gfx::Size FrameCaptionButtonContainerView::GetPreferredSize() { width += kDistanceBetweenButtons; first_visible = false; } - gfx::Insets insets(GetInsets()); - return gfx::Size(width + insets.width(), - close_button_->GetPreferredSize().height() + insets.height()); + return gfx::Size(width, close_button_->GetPreferredSize().height()); } void FrameCaptionButtonContainerView::Layout() { @@ -134,16 +132,7 @@ void FrameCaptionButtonContainerView::Layout() { IDR_AURA_WINDOW_MINIMIZE_SHORT, IDR_AURA_WINDOW_MINIMIZE_SHORT_H, IDR_AURA_WINDOW_MINIMIZE_SHORT_P); - if (header_style_ == HEADER_STYLE_MAXIMIZED_HOSTED_APP) { - SetButtonImages(size_button_, - IDR_AURA_WINDOW_FULLSCREEN_RESTORE, - IDR_AURA_WINDOW_FULLSCREEN_RESTORE_H, - IDR_AURA_WINDOW_FULLSCREEN_RESTORE_P); - SetButtonImages(close_button_, - IDR_AURA_WINDOW_FULLSCREEN_CLOSE, - IDR_AURA_WINDOW_FULLSCREEN_CLOSE_H, - IDR_AURA_WINDOW_FULLSCREEN_CLOSE_P); - } else if (header_style_ == HEADER_STYLE_SHORT) { + if (header_style_ == HEADER_STYLE_SHORT) { // The new assets only make sense if the window is maximized or fullscreen // because we usually use a black header in this case. if ((frame_->IsMaximized() || frame_->IsFullscreen()) && @@ -178,16 +167,14 @@ void FrameCaptionButtonContainerView::Layout() { IDR_AURA_WINDOW_CLOSE_P); } - gfx::Insets insets(GetInsets()); - int x = insets.left(); - int y_inset = insets.top(); + int x = 0; for (int i = 0; i < child_count(); ++i) { views::View* child = child_at(i); if (!child->visible()) continue; gfx::Size size = child->GetPreferredSize(); - child->SetBounds(x, y_inset, size.width(), size.height()); + child->SetBounds(x, 0, size.width(), size.height()); x += size.width() + kDistanceBetweenButtons; } } @@ -199,10 +186,8 @@ const char* FrameCaptionButtonContainerView::GetClassName() const { void FrameCaptionButtonContainerView::OnPaint(gfx::Canvas* canvas) { views::View::OnPaint(canvas); - // The alternate button style and AppNonClientFrameViewAsh do not paint the - // button separator. - if (header_style_ != HEADER_STYLE_MAXIMIZED_HOSTED_APP && - !switches::UseAlternateFrameCaptionButtonStyle()) { + // The alternate button style does not paint the button separator. + if (!switches::UseAlternateFrameCaptionButtonStyle()) { // We should have at most two visible buttons. The button separator is // always painted underneath the close button regardless of whether a // button other than the close button is visible. diff --git a/ash/wm/caption_buttons/frame_caption_button_container_view.h b/ash/wm/caption_buttons/frame_caption_button_container_view.h index 2c7f5e3a3eb263..f8e1a92fcb3a03 100644 --- a/ash/wm/caption_buttons/frame_caption_button_container_view.h +++ b/ash/wm/caption_buttons/frame_caption_button_container_view.h @@ -37,10 +37,7 @@ class ASH_EXPORT FrameCaptionButtonContainerView HEADER_STYLE_SHORT, // Restored tabbed browser windows. - HEADER_STYLE_TALL, - - // AppNonClientFrameViewAsh. - HEADER_STYLE_MAXIMIZED_HOSTED_APP + HEADER_STYLE_TALL }; // |frame| is the views::Widget that the caption buttons act on. diff --git a/ash/wm/caption_buttons/frame_caption_button_container_view_unittest.cc b/ash/wm/caption_buttons/frame_caption_button_container_view_unittest.cc index 84a7347a6d4a61..6737b92d25c313 100644 --- a/ash/wm/caption_buttons/frame_caption_button_container_view_unittest.cc +++ b/ash/wm/caption_buttons/frame_caption_button_container_view_unittest.cc @@ -172,29 +172,6 @@ TEST_F(FrameCaptionButtonContainerViewTestOldStyle, ButtonVisibility) { &container3, *t3.close_button(), *t3.close_button())); } -// Test the layout when a border is set on the container. -TEST_F(FrameCaptionButtonContainerViewTestOldStyle, LayoutBorder) { - const int kTopInset = 1; - const int kLeftInset = 2; - const int kBottomInset = 3; - const int kRightInset = 4; - - scoped_ptr widget(CreateTestWidget(MAXIMIZE_ALLOWED)); - FrameCaptionButtonContainerView container(widget.get(), - FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); - container.set_border(views::Border::CreateEmptyBorder( - kTopInset, kLeftInset, kBottomInset, kRightInset)); - container.Layout(); - FrameCaptionButtonContainerView::TestApi t(&container); - - EXPECT_EQ(kLeftInset, t.size_button()->x()); - EXPECT_EQ(kTopInset, t.close_button()->y()); - EXPECT_EQ(container.GetPreferredSize().height(), - t.close_button()->bounds().bottom() + kBottomInset); - EXPECT_EQ(container.GetPreferredSize().width(), - t.close_button()->bounds().right() + kRightInset); -} - // Test how the header style affects which images are used for the buttons. TEST_F(FrameCaptionButtonContainerViewTestOldStyle, HeaderStyle) { scoped_ptr widget(CreateTestWidget(MAXIMIZE_ALLOWED)); @@ -252,19 +229,6 @@ TEST_F(FrameCaptionButtonContainerViewTestOldStyle, HeaderStyle) { IDR_AURA_WINDOW_MAXIMIZED_CLOSE2, IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_H, IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_P)); - - // AppNonClientFrameViewAsh has a dedicated set of images. - container.set_header_style( - FrameCaptionButtonContainerView::HEADER_STYLE_MAXIMIZED_HOSTED_APP); - container.Layout(); - EXPECT_TRUE(ImagesMatch(t.size_button(), - IDR_AURA_WINDOW_FULLSCREEN_RESTORE, - IDR_AURA_WINDOW_FULLSCREEN_RESTORE_H, - IDR_AURA_WINDOW_FULLSCREEN_RESTORE_P)); - EXPECT_TRUE(ImagesMatch(t.close_button(), - IDR_AURA_WINDOW_FULLSCREEN_CLOSE, - IDR_AURA_WINDOW_FULLSCREEN_CLOSE_H, - IDR_AURA_WINDOW_FULLSCREEN_CLOSE_P)); } class FrameCaptionButtonContainerViewTestAlternateStyle diff --git a/chrome/browser/ui/ash/accelerator_commands_browsertest.cc b/chrome/browser/ui/ash/accelerator_commands_browsertest.cc index 0e807621e65cd7..704fc2fc19b7cd 100644 --- a/chrome/browser/ui/ash/accelerator_commands_browsertest.cc +++ b/chrome/browser/ui/ash/accelerator_commands_browsertest.cc @@ -89,16 +89,13 @@ IN_PROC_BROWSER_TEST_F(AcceleratorCommandsBrowserTest, ToggleFullscreen) { EXPECT_FALSE(browser_window->IsMaximized()); EXPECT_FALSE(browser_window->IsFullscreen()); - // 3) ToggleFullscreen() should maximize v1 app browser windows which use - // AppNonClientFrameViewAsh. - // TODO(pkotwicz): Figure out if we actually want this behavior. + // 3) ToggleFullscreen() should put v1 apps into non-immersive fullscreen. Browser::CreateParams browser_create_params(Browser::TYPE_POPUP, browser()->profile(), chrome::HOST_DESKTOP_TYPE_NATIVE); #if defined(OS_WIN) browser_create_params.host_desktop_type = chrome::HOST_DESKTOP_TYPE_ASH; #endif // OS_WIN browser_create_params.app_name = "Test"; - browser_create_params.app_type = Browser::APP_TYPE_HOST; Browser* app_host_browser = new Browser(browser_create_params); ASSERT_TRUE(app_host_browser->is_app()); @@ -108,25 +105,6 @@ IN_PROC_BROWSER_TEST_F(AcceleratorCommandsBrowserTest, ToggleFullscreen) { EXPECT_FALSE(browser_window->IsMaximized()); EXPECT_FALSE(browser_window->IsFullscreen()); - ash::accelerators::ToggleFullscreen(); - EXPECT_TRUE(browser_window->IsMaximized()); - - ash::accelerators::ToggleFullscreen(); - EXPECT_FALSE(browser_window->IsMaximized()); - EXPECT_FALSE(browser_window->IsFullscreen()); - - // 4) ToggleFullscreen() should put child windows of v1 apps into - // non-immersive fullscreen. - browser_create_params.host_desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE; - browser_create_params.app_type = Browser::APP_TYPE_CHILD; - Browser* app_child_browser = new Browser(browser_create_params); - ASSERT_TRUE(app_child_browser->is_app()); - AddBlankTabAndShow(app_child_browser); - browser_window = app_child_browser->window(); - ASSERT_TRUE(browser_window->IsActive()); - EXPECT_FALSE(browser_window->IsMaximized()); - EXPECT_FALSE(browser_window->IsFullscreen()); - ash::accelerators::ToggleFullscreen(); EXPECT_TRUE(browser_window->IsFullscreen()); EXPECT_FALSE(IsInImmersiveFullscreen(browser_window)); @@ -135,7 +113,7 @@ IN_PROC_BROWSER_TEST_F(AcceleratorCommandsBrowserTest, ToggleFullscreen) { EXPECT_FALSE(browser_window->IsMaximized()); EXPECT_FALSE(browser_window->IsFullscreen()); - // 5) ToggleFullscreen() should put popup browser windows into non-immersive + // 4) ToggleFullscreen() should put popup browser windows into non-immersive // fullscreen. browser_create_params.app_name = ""; Browser* popup_browser = new Browser(browser_create_params); diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc deleted file mode 100644 index 562d4c1b9a2c63..00000000000000 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h" - -#include "ash/wm/caption_buttons/frame_caption_button_container_view.h" -#include "base/i18n/rtl.h" -#include "chrome/browser/ui/views/frame/browser_frame.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "grit/ash_resources.h" -#include "ui/aura/window.h" -#include "ui/base/hit_test.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/gfx/canvas.h" -#include "ui/gfx/image/image.h" -#include "ui/gfx/point.h" -#include "ui/gfx/rect.h" -#include "ui/gfx/size.h" -#include "ui/views/background.h" -#include "ui/views/border.h" -#include "ui/views/widget/widget.h" -#include "ui/views/window/non_client_view.h" - -namespace { - -// The size of the shadow around the caption buttons. -const int kShadowSizeX = 16; -const int kShadowSizeBottom = 21; - -// The border for |control_view_|. -class ControlViewBorder : public views::Border { - public: - ControlViewBorder() { - int border_id = base::i18n::IsRTL() ? - IDR_AURA_WINDOW_FULLSCREEN_SHADOW_RTL : - IDR_AURA_WINDOW_FULLSCREEN_SHADOW; - border_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed( - border_id).AsImageSkia(); - } - - virtual ~ControlViewBorder() { - } - - private: - // views::Border overrides: - virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE { - canvas->DrawImageInt(border_, 0, view.height() - border_.height()); - } - - virtual gfx::Insets GetInsets() const OVERRIDE { - return gfx::Insets(0, kShadowSizeX, kShadowSizeBottom, 0); - } - - gfx::ImageSkia border_; - - DISALLOW_COPY_AND_ASSIGN(ControlViewBorder); -}; - -// The background for |control_view_|. -class ControlViewBackground : public views::Background { - public: - explicit ControlViewBackground(bool is_incognito) { - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - int control_base_resource_id = is_incognito ? - IDR_AURA_WINDOW_HEADER_BASE_INCOGNITO_ACTIVE : - IDR_AURA_WINDOW_HEADER_BASE_ACTIVE; - background_ = rb.GetImageNamed(control_base_resource_id).AsImageSkia(); - } - - virtual ~ControlViewBackground() { - } - - private: - // views::Background override: - virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE { - gfx::Rect paint_bounds(view->GetContentsBounds()); - paint_bounds.set_x(view->GetMirroredXForRect(paint_bounds)); - canvas->TileImageInt(background_, paint_bounds.x(), paint_bounds.y(), - paint_bounds.width(), paint_bounds.height()); - } - - gfx::ImageSkia background_; - - DISALLOW_COPY_AND_ASSIGN(ControlViewBackground); -}; - -} // namespace - -// Observer to detect when the browser frame widget closes so we can clean -// up our ControlView. Because we can be closed via a keyboard shortcut we -// are not guaranteed to run AppNonClientFrameView's Close() or Restore(). -class AppNonClientFrameViewAsh::FrameObserver : public views::WidgetObserver { - public: - explicit FrameObserver(AppNonClientFrameViewAsh* owner) : owner_(owner) {} - virtual ~FrameObserver() {} - - // views::WidgetObserver: - virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE { - owner_->CloseControlWidget(); - } - - private: - AppNonClientFrameViewAsh* owner_; - - DISALLOW_COPY_AND_ASSIGN(FrameObserver); -}; - -// static -const char AppNonClientFrameViewAsh::kViewClassName[] = - "AppNonClientFrameViewAsh"; -// static -const char AppNonClientFrameViewAsh::kControlWindowName[] = - "AppNonClientFrameViewAshControls"; - -AppNonClientFrameViewAsh::AppNonClientFrameViewAsh( - BrowserFrame* frame, BrowserView* browser_view) - : BrowserNonClientFrameView(frame, browser_view), - control_view_(NULL), - control_widget_(NULL), - frame_observer_(new FrameObserver(this)) { - control_view_ = new ash::FrameCaptionButtonContainerView(frame, - ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); - control_view_->set_header_style( - ash::FrameCaptionButtonContainerView::HEADER_STYLE_MAXIMIZED_HOSTED_APP); - control_view_->set_border(new ControlViewBorder()); - control_view_->set_background(new ControlViewBackground( - browser_view->IsOffTheRecord())); - - // This FrameView is always maximized so we don't want the window to have - // resize borders. - frame->GetNativeView()->set_hit_test_bounds_override_inner(gfx::Insets()); - // Watch for frame close so we can clean up the control widget. - frame->AddObserver(frame_observer_.get()); - set_background(views::Background::CreateSolidBackground(SK_ColorBLACK)); - // Create the controls. - control_widget_ = new views::Widget; - views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); - params.parent = browser_view->GetNativeWindow(); - params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; - control_widget_->Init(params); - control_widget_->SetContentsView(control_view_); - aura::Window* window = control_widget_->GetNativeView(); - window->SetName(kControlWindowName); - - // Need to exclude the shadow from the active control area. - gfx::Insets hit_test_insets(control_view_->GetInsets()); - if (base::i18n::IsRTL()) { - hit_test_insets = gfx::Insets(hit_test_insets.top(), - hit_test_insets.right(), - hit_test_insets.bottom(), - hit_test_insets.left()); - } - window->SetHitTestBoundsOverrideOuter(hit_test_insets, hit_test_insets); - - gfx::Rect control_bounds = GetControlBounds(); - window->SetBounds(control_bounds); - control_widget_->Show(); -} - -AppNonClientFrameViewAsh::~AppNonClientFrameViewAsh() { - frame()->RemoveObserver(frame_observer_.get()); - // This frame view can be replaced (and deleted) if the window is restored - // via a keyboard shortcut like Alt-[. Ensure we close the control widget. - CloseControlWidget(); -} - -gfx::Rect AppNonClientFrameViewAsh::GetBoundsForClientView() const { - return GetLocalBounds(); -} - -gfx::Rect AppNonClientFrameViewAsh::GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const { - return client_bounds; -} - -int AppNonClientFrameViewAsh::NonClientHitTest( - const gfx::Point& point) { - return HTNOWHERE; -} - -void AppNonClientFrameViewAsh::GetWindowMask(const gfx::Size& size, - gfx::Path* window_mask) { -} - -void AppNonClientFrameViewAsh::ResetWindowControls() { -} - -void AppNonClientFrameViewAsh::UpdateWindowIcon() { -} - -void AppNonClientFrameViewAsh::UpdateWindowTitle() { -} - -gfx::Rect AppNonClientFrameViewAsh::GetBoundsForTabStrip( - views::View* tabstrip) const { - return gfx::Rect(); -} - -BrowserNonClientFrameView::TabStripInsets -AppNonClientFrameViewAsh::GetTabStripInsets() const { - return TabStripInsets(); -} - -int AppNonClientFrameViewAsh::GetThemeBackgroundXInset() const { - return 0; -} - -void AppNonClientFrameViewAsh::UpdateThrobber(bool running) { -} - -const char* AppNonClientFrameViewAsh::GetClassName() const { - return kViewClassName; -} - -void AppNonClientFrameViewAsh::OnBoundsChanged( - const gfx::Rect& previous_bounds) { - if (control_widget_) - control_widget_->GetNativeView()->SetBounds(GetControlBounds()); -} - -gfx::Rect AppNonClientFrameViewAsh::GetControlBounds() const { - if (!control_view_) - return gfx::Rect(); - gfx::Size preferred = control_view_->GetPreferredSize(); - return gfx::Rect( - base::i18n::IsRTL() ? 0 : (width() - preferred.width()), 0, - preferred.width(), preferred.height()); -} - -void AppNonClientFrameViewAsh::CloseControlWidget() { - if (control_widget_) { - control_widget_->Close(); - control_widget_ = NULL; - } -} diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h deleted file mode 100644 index 9020197ff3214b..00000000000000 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ -#define CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ - -#include "base/memory/scoped_ptr.h" -#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" - -namespace aura { -class Window; -} - -namespace ash { -class FrameCaptionButtonContainerView; -} - -// NonClientFrameViewAsh implementation for maximized apps. -class AppNonClientFrameViewAsh : public BrowserNonClientFrameView { - public: - static const char kViewClassName[]; // visible for test - static const char kControlWindowName[]; // visible for test - - AppNonClientFrameViewAsh( - BrowserFrame* frame, BrowserView* browser_view); - virtual ~AppNonClientFrameViewAsh(); - - // NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; - virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const OVERRIDE; - virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; - virtual void GetWindowMask( - const gfx::Size& size, - gfx::Path* window_mask) OVERRIDE; - virtual void ResetWindowControls() OVERRIDE; - virtual void UpdateWindowIcon() OVERRIDE; - virtual void UpdateWindowTitle() OVERRIDE; - - // BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip( - views::View* tabstrip) const OVERRIDE; - virtual TabStripInsets GetTabStripInsets() const OVERRIDE; - virtual int GetThemeBackgroundXInset() const OVERRIDE; - virtual void UpdateThrobber(bool running) OVERRIDE; - - // views::View: - virtual const char* GetClassName() const OVERRIDE; - virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; - - private: - class FrameObserver; - - gfx::Rect GetControlBounds() const; - - // Closes |control_widget_|. - void CloseControlWidget(); - - // The View containing the restore and close buttons. - ash::FrameCaptionButtonContainerView* control_view_; - // The widget holding the control_view_. - views::Widget* control_widget_; - // Observer for browser frame close. - scoped_ptr frame_observer_; - - DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAsh); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc deleted file mode 100644 index 9be8e981bd0859..00000000000000 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chrome_notification_types.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_finder.h" -#include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/browser_tabstrip.h" -#include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h" -#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "content/public/test/test_utils.h" -#include "ui/aura/client/aura_constants.h" -#include "ui/aura/root_window.h" -#include "ui/aura/test/event_generator.h" -#include "ui/aura/window.h" -#include "ui/gfx/screen.h" - -using aura::Window; - -namespace { - -Window* GetChildWindowNamed(Window* window, const char* name) { - for (size_t i = 0; i < window->children().size(); ++i) { - Window* child = window->children()[i]; - if (child->name() == name) - return child; - } - return NULL; -} - -bool HasChildWindowNamed(Window* window, const char* name) { - return GetChildWindowNamed(window, name) != NULL; -} - -void MaximizeWindow(aura::Window* window) { - window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); -} - -void MinimizeWindow(aura::Window* window) { - window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); -} - -void RestoreWindow(Window* window) { - window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); -} - -} // namespace - -class AppNonClientFrameViewAshTest : public InProcessBrowserTest { - public: - AppNonClientFrameViewAshTest() : InProcessBrowserTest(), app_browser_(NULL) { - } - virtual ~AppNonClientFrameViewAshTest() {} - - virtual void SetUpOnMainThread() OVERRIDE { - Browser::CreateParams params = Browser::CreateParams::CreateForApp( - Browser::TYPE_POPUP, - std::string("Test"), - gfx::Rect(), - browser()->profile(), - browser()->host_desktop_type()); - params.initial_show_state = ui::SHOW_STATE_MAXIMIZED; - params.app_type = Browser::APP_TYPE_HOST; - app_browser_ = new Browser(params); - chrome::AddTabAt(app_browser_, GURL(), -1, true); - app_browser_->window()->Show(); - } - - // Returns the class name of the NonClientFrameView. - std::string GetFrameClassName() const { - BrowserView* browser_view = - static_cast(app_browser_->window()); - BrowserFrame* browser_frame = browser_view->frame(); - return browser_frame->GetFrameView()->GetClassName(); - } - - aura::Window* GetRootWindow() const { - BrowserView* browser_view = - static_cast(app_browser_->window()); - views::Widget* widget = browser_view->GetWidget(); - aura::Window* window = - static_cast(widget->GetNativeWindow()); - return window->GetRootWindow(); - } - - Browser* app_browser() const { return app_browser_; } - - private: - Browser *app_browser_; -}; - -#if defined(USE_ASH) -// Ensure that restoring the app window replaces the frame with a normal one, -// and maximizing again brings back the app frame. This has been the source of -// some crash bugs like crbug.com/155634 -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SwitchFrames) { - // Convert to std::string so Windows can match EXPECT_EQ. - const std::string kAppFrameClassName = - AppNonClientFrameViewAsh::kViewClassName; - const std::string kNormalFrameClassName = - BrowserNonClientFrameViewAsh::kViewClassName; - - // We start with the app frame. - EXPECT_EQ(kAppFrameClassName, GetFrameClassName()); - - // Restoring the window gives us the normal frame. - Window* native_window = app_browser()->window()->GetNativeWindow(); - RestoreWindow(native_window); - EXPECT_EQ(kNormalFrameClassName, GetFrameClassName()); - - // Maximizing the window switches back to the app frame. - MaximizeWindow(native_window); - EXPECT_EQ(kAppFrameClassName, GetFrameClassName()); - - // Minimizing the window switches to normal frame. - // TODO(jamescook): This seems wasteful, since the user is likely to bring - // the window back to the maximized state. - MinimizeWindow(native_window); - EXPECT_EQ(kNormalFrameClassName, GetFrameClassName()); - - // Coming back to maximized switches to app frame. - MaximizeWindow(native_window); - EXPECT_EQ(kAppFrameClassName, GetFrameClassName()); - - // One more restore/maximize cycle for good measure. - RestoreWindow(native_window); - EXPECT_EQ(kNormalFrameClassName, GetFrameClassName()); - MaximizeWindow(native_window); - EXPECT_EQ(kAppFrameClassName, GetFrameClassName()); -} -#endif // USE_ASH - -// Ensure that we can click the close button when the controls are shown. -// In particular make sure that we can click it on the top pixel of the button. -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ClickClose) { - aura::Window* root_window = GetRootWindow(); - aura::test::EventGenerator eg(root_window, gfx::Point(0, 1)); - - // Click close button. - eg.MoveMouseTo(root_window->bounds().width() - 1, 0); - content::WindowedNotificationObserver signal( - chrome::NOTIFICATION_BROWSER_CLOSED, - content::Source(app_browser())); - eg.ClickLeftButton(); - signal.Wait(); - EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(), - browser()->host_desktop_type())); -} - -// Ensure that closing a maximized app with Ctrl-W does not crash the -// application. crbug.com/147635 -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, KeyboardClose) { - aura::Window* root_window = GetRootWindow(); - aura::test::EventGenerator eg(root_window); - - // Base browser and app browser. - EXPECT_EQ(2u, chrome::GetBrowserCount(browser()->profile(), - browser()->host_desktop_type())); - - // Send Control-W. - content::WindowedNotificationObserver signal( - chrome::NOTIFICATION_BROWSER_CLOSED, - content::Source(app_browser())); - eg.PressKey(ui::VKEY_W, ui::EF_CONTROL_DOWN); - eg.ReleaseKey(ui::VKEY_W, ui::EF_CONTROL_DOWN); - signal.Wait(); - - // App browser is closed. - EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(), - browser()->host_desktop_type())); -} - -// Ensure that snapping left with Alt-[ closes the control window. -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SnapLeftClosesControls) { - aura::Window* root_window = GetRootWindow(); - aura::test::EventGenerator eg(root_window); - aura::Window* native_window = app_browser()->window()->GetNativeWindow(); - - // Control window exists. - EXPECT_TRUE(HasChildWindowNamed( - native_window, AppNonClientFrameViewAsh::kControlWindowName)); - - // Send Alt-[ - eg.PressKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN); - eg.ReleaseKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN); - content::RunAllPendingInMessageLoop(); - - // Control window is gone. - EXPECT_FALSE(HasChildWindowNamed( - native_window, AppNonClientFrameViewAsh::kControlWindowName)); -} - -// Ensure that the controls are at the proper locations. -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ControlsAtRightSide) { - aura::Window* root_window = GetRootWindow(); - aura::test::EventGenerator eg(root_window); - aura::Window* native_window = app_browser()->window()->GetNativeWindow(); - const gfx::Rect work_area = - gfx::Screen::GetScreenFor(native_window)->GetPrimaryDisplay().work_area(); - - // Control window exists. - aura::Window* window = GetChildWindowNamed( - native_window, AppNonClientFrameViewAsh::kControlWindowName); - - ASSERT_TRUE(window); - gfx::Rect rect = window->bounds(); - EXPECT_EQ(work_area.right(), rect.right()); - EXPECT_EQ(work_area.y(), rect.y()); - - MinimizeWindow(native_window); - content::RunAllPendingInMessageLoop(); - window = GetChildWindowNamed( - native_window, AppNonClientFrameViewAsh::kControlWindowName); - EXPECT_FALSE(window); - MaximizeWindow(native_window); - content::RunAllPendingInMessageLoop(); - - // Control window exists. - aura::Window* window_after = GetChildWindowNamed( - native_window, AppNonClientFrameViewAsh::kControlWindowName); - ASSERT_TRUE(window_after); - gfx::Rect rect_after = window_after->bounds(); - EXPECT_EQ(work_area.right(), rect_after.right()); - EXPECT_EQ(work_area.y(), rect_after.y()); -} diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.cc b/chrome/browser/ui/views/frame/browser_frame_ash.cc index 626e5e3f36d6b7..531011e7b34f7f 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.cc +++ b/chrome/browser/ui/views/frame/browser_frame_ash.cc @@ -19,8 +19,8 @@ using aura::Window; namespace { -// BrowserWindowStateDelegate classe handles a user's fullscreen -// request (Shift+F4/F4) for browser (tabbed/popup) windows. +// BrowserWindowStateDelegate class handles a user's fullscreen +// request (Shift+F4/F4). class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { public: explicit BrowserWindowStateDelegate(Browser* browser) @@ -44,82 +44,8 @@ class BrowserWindowStateDelegate : public ash::wm::WindowStateDelegate { DISALLOW_COPY_AND_ASSIGN(BrowserWindowStateDelegate); }; -// AppNonClientFrameViewAsh shows only the window controls and no -// other window decorations which is pretty close to fullscreen. Put -// v1 apps into maximized mode instead of fullscreen to avoid showing -// the ugly fullscreen exit bubble. This is used for V1 apps. -class AppWindowStateDelegate : public ash::wm::WindowStateDelegate { - public: - explicit AppWindowStateDelegate(Browser* browser) - : browser_(browser) { - DCHECK(browser_); - } - virtual ~AppWindowStateDelegate(){} - - // Overridden from ash::wm::WindowStateDelegate. - virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) OVERRIDE { - DCHECK(window_state->IsFullscreen() || window_state->CanMaximize()); - if (window_state->IsFullscreen()) - chrome::ToggleFullscreenMode(browser_); - else - window_state->ToggleMaximized(); - return true; - } - - private: - Browser* browser_; // not owned. - - DISALLOW_COPY_AND_ASSIGN(AppWindowStateDelegate); -}; - - } // namespace -//////////////////////////////////////////////////////////////////////////////// -// BrowserFrameAsh::WindowPropertyWatcher - -class BrowserFrameAsh::WindowPropertyWatcher : public aura::WindowObserver { - public: - explicit WindowPropertyWatcher(BrowserFrameAsh* browser_frame_ash, - BrowserFrame* browser_frame) - : browser_frame_ash_(browser_frame_ash), - browser_frame_(browser_frame) {} - - virtual void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) OVERRIDE { - if (key != aura::client::kShowStateKey) - return; - - ui::WindowShowState old_state = static_cast(old); - ui::WindowShowState new_state = - window->GetProperty(aura::client::kShowStateKey); - - // Allow the frame to be replaced when entering or exiting the maximized - // state. - if (browser_frame_->non_client_view() && - browser_frame_ash_->browser_view()->browser()->is_app() && - (old_state == ui::SHOW_STATE_MAXIMIZED || - new_state == ui::SHOW_STATE_MAXIMIZED)) { - // Defer frame layout when replacing the frame. Layout will occur when the - // window's bounds are updated. The window maximize/restore animations - // clone the window's layers and rely on the subsequent layout to set - // the layer sizes. - // If the window is minimized, the frame view needs to be updated via - // an OnBoundsChanged event so that the frame will change its size - // properly. - browser_frame_->non_client_view()->UpdateFrame( - old_state == ui::SHOW_STATE_MINIMIZED); - } - } - - private: - BrowserFrameAsh* browser_frame_ash_; - BrowserFrame* browser_frame_; - - DISALLOW_COPY_AND_ASSIGN(WindowPropertyWatcher); -}; - /////////////////////////////////////////////////////////////////////////////// // BrowserFrameAsh, public: @@ -129,22 +55,14 @@ const char BrowserFrameAsh::kWindowName[] = "BrowserFrameAsh"; BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame, BrowserView* browser_view) : views::NativeWidgetAura(browser_frame), - browser_view_(browser_view), - window_property_watcher_(new WindowPropertyWatcher(this, browser_frame)) { + browser_view_(browser_view) { GetNativeWindow()->SetName(kWindowName); - GetNativeWindow()->AddObserver(window_property_watcher_.get()); Browser* browser = browser_view->browser(); ash::wm::WindowState* window_state = ash::wm::GetWindowState(GetNativeWindow()); - if (browser->is_app() && browser->app_type() != Browser::APP_TYPE_CHILD) { - window_state->SetDelegate( - scoped_ptr( - new AppWindowStateDelegate(browser)).Pass()); - } else { - window_state->SetDelegate( - scoped_ptr( - new BrowserWindowStateDelegate(browser)).Pass()); - } + window_state->SetDelegate( + scoped_ptr( + new BrowserWindowStateDelegate(browser)).Pass()); window_state->set_animate_to_fullscreen(!browser->is_type_tabbed()); // Turn on auto window management if we don't need an explicit bounds. @@ -162,13 +80,6 @@ BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame, /////////////////////////////////////////////////////////////////////////////// // BrowserFrameAsh, views::NativeWidgetAura overrides: -void BrowserFrameAsh::OnWindowDestroying() { - // Window is destroyed before our destructor is called, so clean up our - // observer here. - GetNativeWindow()->RemoveObserver(window_property_watcher_.get()); - views::NativeWidgetAura::OnWindowDestroying(); -} - void BrowserFrameAsh::OnWindowTargetVisibilityChanged(bool visible) { if (visible) { // Once the window has been shown we know the requested bounds diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.h b/chrome/browser/ui/views/frame/browser_frame_ash.h index a8da5f89747f65..a3385b224a4e86 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.h +++ b/chrome/browser/ui/views/frame/browser_frame_ash.h @@ -30,7 +30,6 @@ class BrowserFrameAsh : public views::NativeWidgetAura, protected: // Overridden from views::NativeWidgetAura: - virtual void OnWindowDestroying() OVERRIDE; virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; // Overridden from NativeBrowserFrame: @@ -50,8 +49,6 @@ class BrowserFrameAsh : public views::NativeWidgetAura, // The BrowserView is our ClientView. This is a pointer to it. BrowserView* browser_view_; - scoped_ptr window_property_watcher_; - DISALLOW_COPY_AND_ASSIGN(BrowserFrameAsh); }; diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc index 0d9e8efc64205d..fc79d1ce9cd042 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc @@ -8,7 +8,6 @@ #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" #if defined(USE_ASH) -#include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h" #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" #endif @@ -29,13 +28,6 @@ BrowserNonClientFrameView* CreateBrowserNonClientFrameView( } #endif #if defined(USE_ASH) - // If this is an app window and it's maximized, use the special frame_view. - if (browser_view->browser()->is_app() && - browser_view->browser()->app_type() != Browser::APP_TYPE_CHILD && - browser_view->IsMaximized()) - return new AppNonClientFrameViewAsh(frame, browser_view); - - // Default is potentially translucent fancy frames. BrowserNonClientFrameViewAsh* frame_view = new BrowserNonClientFrameViewAsh(frame, browser_view); frame_view->Init(); diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 83ae255654964e..6de76bfcb550e9 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -1810,8 +1810,6 @@ 'browser/ui/views/find_bar_view.h', 'browser/ui/views/first_run_bubble.cc', 'browser/ui/views/first_run_bubble.h', - 'browser/ui/views/frame/app_non_client_frame_view_ash.cc', - 'browser/ui/views/frame/app_non_client_frame_view_ash.h', 'browser/ui/views/frame/app_panel_browser_frame_view.cc', 'browser/ui/views/frame/app_panel_browser_frame_view.h', 'browser/ui/views/frame/browser_frame.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 3bf8f10af1bb40..5da720765638a4 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1466,7 +1466,6 @@ 'browser/ui/toolbar/test_toolbar_model.cc', 'browser/ui/toolbar/test_toolbar_model.h', 'browser/ui/views/avatar_menu_button_browsertest.cc', - 'browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc', 'browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc', 'browser/ui/views/frame/browser_view_browsertest.cc', 'browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc', diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc index 40908c27b316b9..5e5cf4a271c6c1 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc @@ -791,7 +791,7 @@ void DesktopRootWindowHostWin::HandleClientSizeChanged( void DesktopRootWindowHostWin::HandleFrameChanged() { SetWindowTransparency(); // Replace the frame and layout the contents. - GetWidget()->non_client_view()->UpdateFrame(true); + GetWidget()->non_client_view()->UpdateFrame(); } void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) { diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc index 2d328d6f4d3f1b..54f423c8ea27fb 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc @@ -578,7 +578,7 @@ void DesktopRootWindowHostX11::FrameTypeChanged() { // Replace the frame and layout the contents. Even though we don't have a // swapable glass frame like on Windows, we still replace the frame because // the button assets don't update otherwise. - native_widget_delegate_->AsWidget()->non_client_view()->UpdateFrame(true); + native_widget_delegate_->AsWidget()->non_client_view()->UpdateFrame(); } NonClientFrameView* DesktopRootWindowHostX11::CreateNonClientFrameView() { diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index f9102fa4bea1a9..d0f20a6cc3a007 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -740,7 +740,7 @@ void NativeWidgetWin::HandleClientSizeChanged(const gfx::Size& new_size) { void NativeWidgetWin::HandleFrameChanged() { // Replace the frame and layout the contents. - GetWidget()->non_client_view()->UpdateFrame(true); + GetWidget()->non_client_view()->UpdateFrame(); } void NativeWidgetWin::HandleNativeFocus(HWND last_focused_window) { diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index 11de715ac0bfaa..f7cd70e5cd3db0 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc @@ -73,14 +73,12 @@ void NonClientView::WindowClosing() { client_view_->WidgetClosing(); } -void NonClientView::UpdateFrame(bool layout) { +void NonClientView::UpdateFrame() { Widget* widget = GetWidget(); SetFrameView(widget->CreateNonClientFrameView()); widget->ThemeChanged(); - if (layout) { - Layout(); - SchedulePaint(); - } + Layout(); + SchedulePaint(); } void NonClientView::SetInactiveRenderingDisabled(bool disable) { diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index 73ed77f846f851..2c3b1d9fe49e32 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h @@ -160,9 +160,8 @@ class VIEWS_EXPORT NonClientView : public View { void WindowClosing(); // Replaces the frame view with a new one. Used when switching window theme - // or frame style. Pass true for |layout| to refresh the window layout (the - // common case) or false if you will trigger layout yourself. - void UpdateFrame(bool layout); + // or frame style. + void UpdateFrame(); // Prevents the window from being rendered as deactivated when |disable| is // true, until called with |disable| false. Used when a sub-window is to be