[sync] Prevent SyncSetupOverlay.closeOverlay() from closing non-sync overlays
[sync] Prevent SyncSetupOverlay.closeOverlay() from closing non-sync overlays

The chrome webui settings page contains code to hide the sync settings
overlay if sync is disabled or if the user is signed out in the
background while the overlay is visible. It does so by calling the
SyncSetupOverlay.CloseOverlay() function.

It turns out that if SyncSetupOverlay.closeOverlay() is called when
the sync settings overlay is not visible, it will close whatever overlay
is visible (in case of bug 244141, the clear-browsing-data overlay).

This patch modifies SyncSetupOverlay.CloseOverlay() to only close the
sync setup overlay if it is visible, and not any other overlay.

BUG=244141
TEST=All non-sync settings UI overlays must stay visible when the user is disconnected or when sync is disabled.
R=zea@chromium.org

Review URL: https://codereview.chromium.org/15740030

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@202687 0039d316-1c4b-4281-b951-d872f2087c98

ChromiumWebApps/chromium,dushu1203/chromium.src,Just-D/chromium-1,jaruba/chromium.src,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,ltilve/chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,ondra-novak/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,Chilledheart/chromium,ltilve/chromium,hujiajie/pa-chromium,patrickm/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,M4sse/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,anirudhSK/chromium,Chilledheart/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,ltilve/chromium,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,dednal/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,chuan9/chromium-crosswalk,hujiajie/pa-chromium,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,ltilve/chromium,mogoweb/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,Chilledheart/chromium,ChromiumWebApps/chromium,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,Chilledheart/chromium,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,Just-D/chromium-1,fujunwei/chromium-crosswalk,littlstar/chromium.src,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,ChromiumWebApps/chromium,Just-D/chromium-1,M4sse/chromium.src,jaruba/chromium.src,Jonekee/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,axinging/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,dednal/chromium.src,Just-D/chromium-1,anirudhSK/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,patrickm/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,ltilve/chromium,dushu1203/chromium.src,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk