From 92a4b25e472653b7f854c2fc18983d77fce37cef Mon Sep 17 00:00:00 2001 From: Rus Maxham Date: Mon, 23 Jun 2014 12:48:52 -0700 Subject: [PATCH 1/3] - remember position and size of developer tools window --- brightray/browser/mac/bry_inspectable_web_contents_view.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index af78def9899..da264327e6e 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -156,6 +156,7 @@ void SetActive(content::WebContents* web_contents, bool active) { _private->window.delegate = self; _private->window.releasedWhenClosed = NO; _private->window.title = @"Developer Tools"; + _private->window.frameAutosaveName = @"Developer Tools"; [_private->window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; [_private->window setContentBorderThickness:24 forEdge:NSMaxYEdge]; } From 3acba90225a42b8f1999fe9466c0b76133d1595b Mon Sep 17 00:00:00 2001 From: Rus Maxham Date: Mon, 23 Jun 2014 13:12:20 -0700 Subject: [PATCH 2/3] brightray namespaced frameAutosaveName --- brightray/browser/mac/bry_inspectable_web_contents_view.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index da264327e6e..84928d7990f 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -156,7 +156,7 @@ void SetActive(content::WebContents* web_contents, bool active) { _private->window.delegate = self; _private->window.releasedWhenClosed = NO; _private->window.title = @"Developer Tools"; - _private->window.frameAutosaveName = @"Developer Tools"; + _private->window.frameAutosaveName = @"brightray.developer.tools"; [_private->window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; [_private->window setContentBorderThickness:24 forEdge:NSMaxYEdge]; } @@ -188,7 +188,7 @@ void SetActive(content::WebContents* web_contents, bool active) { if (!devToolsWebContents) return NO; auto devToolsView = devToolsWebContents->GetView()->GetNativeView(); - + return _private->window && devToolsView.window == _private->window; } @@ -200,7 +200,7 @@ void SetActive(content::WebContents* web_contents, bool active) { SetActive(inspectable_contents->devtools_web_contents(), active); return; } - + // Changes the window that hosts us always affect our main web contents. If the dev tools are also // hosted in this window, they are affected too. SetActive(inspectable_contents->GetWebContents(), active); From cca71fce9f180a478c19558b98e676ca24dbb644 Mon Sep 17 00:00:00 2001 From: Rus Maxham Date: Mon, 23 Jun 2014 13:16:01 -0700 Subject: [PATCH 3/3] less removal of whitespace --- brightray/browser/mac/bry_inspectable_web_contents_view.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index 84928d7990f..4a8b9fd94c0 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -188,7 +188,7 @@ void SetActive(content::WebContents* web_contents, bool active) { if (!devToolsWebContents) return NO; auto devToolsView = devToolsWebContents->GetView()->GetNativeView(); - + return _private->window && devToolsView.window == _private->window; } @@ -200,7 +200,7 @@ void SetActive(content::WebContents* web_contents, bool active) { SetActive(inspectable_contents->devtools_web_contents(), active); return; } - + // Changes the window that hosts us always affect our main web contents. If the dev tools are also // hosted in this window, they are affected too. SetActive(inspectable_contents->GetWebContents(), active);