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

Unified Diff: chrome/browser/debugger/devtools_window.h

Issue 11272015: DevTools: “Dock to right” broken after turning a tab into a window of its own. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GTK comments addressed, docs updated. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/debugger/devtools_window.h
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index 84dc217201d1920448872d67372acc452c016c39..0501a3746dbe07e2c6db202c7aa23c147bed3657 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -87,9 +87,25 @@ class DevToolsWindow : private content::NotificationObserver,
TabContents* tab_contents() { return tab_contents_; }
Browser* browser() { return browser_; } // For tests.
DevToolsDockSide dock_side() { return dock_side_; }
- content::DevToolsClientHost* devtools_client_host() {
- return frontend_host_;
- }
+ content::DevToolsClientHost* devtools_client_host() { return frontend_host_; }
+
+ // 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);
+
+ // 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);
private:
static DevToolsWindow* Create(Profile* profile,
@@ -183,6 +199,8 @@ class DevToolsWindow : private content::NotificationObserver,
content::NotificationRegistrar registrar_;
content::DevToolsClientHost* frontend_host_;
scoped_ptr<DevToolsFileHelper> file_helper_;
+ int width_;
+ int height_;
DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
};
« no previous file with comments | « no previous file | chrome/browser/debugger/devtools_window.cc » ('j') | chrome/browser/debugger/devtools_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698