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

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

Issue 9517010: Change panels to be able to turn off autoresize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index c0392649c2d607fd13e50c8a140d99861af57e2f..f10d868d7ce09f018dc3d6b13e42a3af038b58b0 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -126,6 +126,14 @@ void Panel::SetAutoResizable(bool resizable) {
} else {
browser()->tabstrip_model()->RemoveObserver(this);
registrar_.RemoveAll();
+
+ WebContents* web_contents = browser()->GetSelectedWebContents();
jennb 2012/02/28 23:45:15 This is repeated in the if-section too. Move befor
levin 2012/02/29 00:04:43 Done.
+ if (web_contents) {
+ // NULL might be returned if the tab has not been added.
+ RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
+ if (render_view_host)
+ render_view_host->DisableAutoResize(restored_size_);
+ }
}
}
@@ -625,10 +633,9 @@ void Panel::ShowKeyboardOverlay(gfx::NativeWindow owning_window) {
void Panel::UpdatePreferredSize(WebContents* web_contents,
const gfx::Size& pref_size) {
- if (auto_resizable_) {
- return manager()->OnPreferredWindowSizeChanged(this,
- native_panel_->WindowSizeFromContentSize(pref_size));
- }
+ DCHECK(auto_resizable_);
+ return manager()->OnPreferredWindowSizeChanged(this,
+ native_panel_->WindowSizeFromContentSize(pref_size));
}
void Panel::ShowAvatarBubble(WebContents* web_contents, const gfx::Rect& rect) {
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | chrome/browser/ui/panels/panel_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698