Chromium Code Reviews| Index: chrome/browser/devtools/devtools_window.h |
| diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h |
| index b2161ce019c9b21926d7825379f6b042d2379b3e..db3b1b2e0d332311ee93218d6c8b74f03e013014 100644 |
| --- a/chrome/browser/devtools/devtools_window.h |
| +++ b/chrome/browser/devtools/devtools_window.h |
| @@ -21,6 +21,7 @@ |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| #include "content/public/browser/web_contents_delegate.h" |
| +#include "ui/gfx/size.h" |
| class Browser; |
| class BrowserWindow; |
| @@ -96,8 +97,6 @@ class DevToolsWindow : private content::NotificationObserver, |
| static void InspectElement( |
| content::RenderViewHost* inspected_rvh, int x, int y); |
| - static int GetMinimumWidth(); |
| - static int GetMinimumHeight(); |
| static int GetMinimizedHeight(); |
| // content::DevToolsFrontendHostDelegate: |
| @@ -110,23 +109,15 @@ class DevToolsWindow : private content::NotificationObserver, |
| content::RenderViewHost* GetRenderViewHost(); |
| content::DevToolsClientHost* GetDevToolsClientHostForTest(); |
| - // Returns preferred devtools window width for given |container_width|. It |
| - // tries to use the saved window width, or, if none exists, 1/3 of the |
| - // container width, then clamps to try and ensure both devtools and content |
| - // are at least somewhat visible. |
| - // Called only for the case when devtools window is docked to the side. |
| - int GetWidth(int container_width); |
| + // Inspected WebContents is placed over DevTools WebContents in docked mode. |
| + // The following methods return the top-left and bottom-right offsets of |
| + // inspected WebContents relative to DevTools WebContents. |
| + gfx::Size GetTopLeftContentsOffset() const; |
|
pfeldman
2013/11/18 14:18:27
gfx::Rect GetContentsRect
dgozman
2013/11/18 14:37:14
The whole idea of offsets is that on resize views
pfeldman
2013/11/20 15:02:08
Ok, sgtm.
Did you measure the overhead though? I
dgozman
2013/11/21 15:08:54
I didn't measure the overhead. But this scenario w
|
| + gfx::Size GetBottomRightContentsOffset() const; |
| - // Returns preferred devtools window height for given |container_height|. |
| - // Uses the same logic as GetWidth. |
| - // Called only for the case when devtools window is docked to bottom. |
| - int GetHeight(int container_height); |
| - |
| - // Stores preferred devtools window width for this instance. |
| - void SetWidth(int width); |
| - |
| - // Stores preferred devtools window height for this instance. |
| - void SetHeight(int height); |
| + // Minimum size of the docked DevTools WebContents. This includes |
| + // the overlaying inspected WebContents size. |
| + gfx::Size GetMinimumSize() const; |
| void Show(const DevToolsToggleAction& action); |
| @@ -274,7 +265,8 @@ class DevToolsWindow : private content::NotificationObserver, |
| virtual void ActivateWindow() OVERRIDE; |
| virtual void ActivateContents(content::WebContents* contents) OVERRIDE; |
| virtual void CloseWindow() OVERRIDE; |
| - virtual void SetWindowBounds(int x, int y, int width, int height) OVERRIDE; |
| + virtual void SetContentsOffsets( |
| + int left, int top, int right, int bottom) OVERRIDE; |
| virtual void MoveWindow(int x, int y) OVERRIDE; |
| virtual void SetDockSide(const std::string& side) OVERRIDE; |
| virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
| @@ -354,8 +346,8 @@ class DevToolsWindow : private content::NotificationObserver, |
| scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > |
| IndexingJobsMap; |
| IndexingJobsMap indexing_jobs_; |
| - int width_; |
| - int height_; |
| + gfx::Size top_left_contents_offset_; |
| + gfx::Size bottom_right_contents_offset_; |
| DevToolsDockSide dock_side_before_minimized_; |
| // True if we're in the process of handling a beforeunload event originating |
| // from the inspected webcontents, see InterceptPageBeforeUnload for details. |