Re-adjust NSView hierarchy for devtools
Re-adjust NSView hierarchy for devtools

This happens to fix a bug that was causing the developer tools
underlay to become an overlay. The reason for this is an
undocumented behavior of NSView::setLayer.

Ordinarily, the NSView hierarchy and the CALayer hierarchy
match. That is, the ordering of a NSView's subviews' CALayers is
the same as the ordering of the NSView's CALayer's sublayers.
This gets completely broken when you call setLayer on a NSView.
The new CALayer will be appended to the end of the NSView's
superview's CALayer's sublayer array, even if that NSView wasn't at
the end of its superview's subview array.

This changes the hierarchy from:
- DevToolsContainerView
..- WebContentsViewCocoa
....- RenderWidgetHostViewCocoa (dev tools underlay)
....- NSView (overlayableContentsContainer_)
......- NSView (switchView_)
........- NSView (tabContentsController view)
..........- WebContentsViewCocoa
............- RenderWidgetHostViewCocoa (web contents overlay)

To:
- DevToolsContainerView
..- WebContentsViewCocoa
....- RenderWidgetHostViewCocoa (dev tools underlay)
..- NSView (overlayableContentsContainer_)
....- NSView (switchView_)
......- NSView (tabContentsController view)
........- WebContentsViewCocoa
............- RenderWidgetHostViewCocoa (web contents overlay)

The RenderWidgetHostViewCocoa has setLayer called on it.

This happens to work around the bug by making it so that
the WebContentsViewCocoa only has one child NSView, and
its child only has one CALayer. As a result, the ordering of its
children is always consistent between NSViews and CALayers.

A follow-up patch will make it so that RWHVCocoa does not
have setLayer called on it.

NOTRY=True
BUG=348490

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

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

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