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

Unified Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 7537030: Make panel adjust bounds per preferred size change notification on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/ui/panels/panel_browser_view.cc
===================================================================
--- chrome/browser/ui/panels/panel_browser_view.cc (revision 94932)
+++ chrome/browser/ui/panels/panel_browser_view.cc (working copy)
@@ -86,6 +86,8 @@
void PanelBrowserView::SetBounds(const gfx::Rect& bounds) {
bounds_ = bounds;
+ if (panel_->expansion_state() == Panel::EXPANDED)
+ original_height_ = bounds.height();
//// No animation if the panel is being dragged.
if (mouse_dragging_) {
@@ -177,10 +179,36 @@
ShowInactive();
}
+gfx::Rect PanelBrowserView::GetPanelRestoredBounds() const {
+ if (panel_->expansion_state() == Panel::EXPANDED)
+ return bounds_;
+
+ gfx::Rect bounds(bounds_);
+ bounds.set_height(original_height_);
+ return bounds;
+}
+
gfx::Rect PanelBrowserView::GetPanelBounds() const {
return bounds_;
}
+void PanelBrowserView::SetPanelRestoredBounds(const gfx::Rect& bounds) {
+ if (panel_->expansion_state() == Panel::EXPANDED) {
+ SetBounds(bounds);
+ return;
+ }
+
+ // We only allow changing width and height.
+ original_height_ = bounds.height();
+
+ if (bounds.width() != bounds_.width()) {
Dmitry Titov 2011/08/05 19:02:20 This calc should be in PanelManager, and it will b
jianli 2011/08/09 19:56:16 Done.
+ gfx::Rect new_bounds(bounds_);
+ new_bounds.set_x(bounds_.x() + bounds_.width() - bounds.width());
+ new_bounds.set_width(bounds.width());
+ SetBounds(new_bounds);
+ }
+}
+
void PanelBrowserView::SetPanelBounds(const gfx::Rect& bounds) {
SetBounds(bounds);
}
@@ -297,6 +325,10 @@
GetFrameView()->SchedulePaint();
}
+gfx::Size PanelBrowserView::GetNonClientAreaSize() const {
+ return GetFrameView()->NonClientAreaSize();
+}
+
Browser* PanelBrowserView::GetPanelBrowser() const {
return browser();
}

Powered by Google App Engine
This is Rietveld 408576698