Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Issue 1228863006: devtools: avoid relying on the internal variables for browser (Closed)

Created:
5 years, 5 months ago by llandwerlin-old
Modified:
5 years, 5 months ago
Reviewers:
CC:
chromium-reviews, yurys, pfeldman, devtools-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

devtools: avoid relying on the internal variables for browser When the devtools are undocked, they live in their own browser. The devtools could be moved to a different browser through the chrome.tabs extension. This makes variables of the DevtoolsWindows out of sync with the actual browser containing the devtools. This CL removes the internal Browser* pointer and introduce methods to retrieve the information from the browser list. BUG=394341, 427226

Patch Set 1 #

Patch Set 2 : Add DetachFromBrowser() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -50 lines) Patch
M chrome/browser/devtools/devtools_window.h View 1 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/devtools/devtools_window.cc View 1 18 chunks +66 lines, -44 lines 0 comments Download
M chrome/browser/devtools/devtools_window_testing.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
llandwerlin-old
dgozman@: Could review this change to the devtools? Thanks. Adding kalman@ who is reviewer on ...
5 years, 5 months ago (2015-07-14 09:09:50 UTC) #2
dgozman
Why do you do this? If I remember correctly, in issue 427226 I specifically disabled ...
5 years, 5 months ago (2015-07-14 12:47:16 UTC) #3
llandwerlin-old
On 2015/07/14 12:47:16, dgozman wrote: > Why do you do this? If I remember correctly, ...
5 years, 5 months ago (2015-07-14 13:11:51 UTC) #4
dgozman
On 2015/07/14 13:11:51, llandwerlin wrote: > On 2015/07/14 12:47:16, dgozman wrote: > > Why do ...
5 years, 5 months ago (2015-07-14 13:19:21 UTC) #5
not at google - send to devlin
On 2015/07/14 13:19:21, dgozman wrote: > On 2015/07/14 13:11:51, llandwerlin wrote: > > On 2015/07/14 ...
5 years, 5 months ago (2015-07-14 17:18:06 UTC) #6
llandwerlin-old
On 2015/07/14 17:18:06, kalman wrote: > On 2015/07/14 13:19:21, dgozman wrote: > > On 2015/07/14 ...
5 years, 5 months ago (2015-07-14 17:33:04 UTC) #7
not at google - send to devlin
5 years, 5 months ago (2015-07-14 17:35:46 UTC) #8
On 2015/07/14 17:33:04, llandwerlin wrote:
> On 2015/07/14 17:18:06, kalman wrote:
> > On 2015/07/14 13:19:21, dgozman wrote:
> > > On 2015/07/14 13:11:51, llandwerlin wrote:
> > > > On 2015/07/14 12:47:16, dgozman wrote:
> > > > > Why do you do this? If I remember correctly, in issue 427226 I
> > specifically
> > > > > disabled extensions access to devtools. I don't think we should expose
> it
> > > yet
> > > > > even complicate devtools window code.
> > > > 
> > > > In 394341 we're trying to list a broader set of windows so extensions
> using
> > > the
> > > > chrome.windows API are able to move all the windows within a given
> profile.
> > > That
> > > > includes application windows as well as devtools windows. This is mainly
> to
> > > let
> > > > an extension layout windows on a ChromeOS.
> > > > 
> > > > It seems the issue in 427226 is that DevtoolWindows couldn't know that
its
> > > > WebContents was being reattached to a different browser. This CL is
about
> > > > removing that assumption, by always figuring out what browser the
devtools
> > are
> > > > attached to, when the information is needed.
> > > 
> > > We can't afford to place DevTools in a regular browser. Browser class even
> has
> > > is_devtools() method which is checked around.
> > > I'd rather we ban DevTools from extension APIs. I can't imagine a lot of
> users
> > > which both have extension managing windows _and_ DevTools open.
> > 
> > I don't mind exposing devtools windows to extensions, so long as it works. I
> > don't see a reason not to.
> > However we should set an appropriate WindowType:
> > https://developer.chrome.com/extensions/tabs#type-WindowType
> 
> They're currently reported as "popup".
> Browser::is_app() will return true for a devtools window, should we set their
> type to "app" or create a new "devtools" type?

I think a separate devtools makes most sense. It's definitely not an app window
(I presume/hope these are reserved for windows created via the chrome.app.window
API). A popup also doesn't sound right.

Powered by Google App Engine
This is Rietveld 408576698