Merge pull request #31 from brightray/less-flashing

Fix flashing in devtools views
This commit is contained in:
Adam Roben 2013-10-10 13:29:14 -07:00
commit c949fd931c
2 changed files with 15 additions and 1 deletions

View file

@ -2,10 +2,18 @@
#include "browser/inspectable_web_contents_impl.h"
#include "content/public/browser/web_contents_view.h"
namespace brightray {
InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) {
return Create(content::WebContents::Create(create_params));
auto contents = content::WebContents::Create(create_params);
#if defined(OS_MACOSX)
// Work around http://crbug.com/279472.
contents->GetView()->SetAllowOverlappingViews(true);
#endif
return Create(contents);
}
InspectableWebContents* InspectableWebContents::Create(content::WebContents* web_contents) {

View file

@ -58,6 +58,12 @@ content::WebContents* InspectableWebContentsImpl::GetWebContents() const {
void InspectableWebContentsImpl::ShowDevTools() {
if (!devtools_web_contents_) {
devtools_web_contents_.reset(content::WebContents::Create(content::WebContents::CreateParams(web_contents_->GetBrowserContext())));
#if defined(OS_MACOSX)
// Work around http://crbug.com/279472.
devtools_web_contents_->GetView()->SetAllowOverlappingViews(true);
#endif
Observe(devtools_web_contents_.get());
devtools_web_contents_->SetDelegate(this);