summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 18:23:24 +0000
committerjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 18:23:24 +0000
commit9fb325e547966820616fca74cf176b254030e56f (patch)
tree61124480daaffab0e4d804f8c82efd7ac87c593f /chrome/browser/tab_contents
parent14d4008ef28b060cb2c9cd4c252bd63e1e8da22e (diff)
downloadchromium_src-9fb325e547966820616fca74cf176b254030e56f.zip
chromium_src-9fb325e547966820616fca74cf176b254030e56f.tar.gz
chromium_src-9fb325e547966820616fca74cf176b254030e56f.tar.bz2
The app launcher had a height of zero as it was not getting preferred size updates
notifications. The wrong render was getting told to report preferred size updates. We now make sure we enable preferred size notifications when the render view host is created. Also removed a check for the view type in render_view.cc that was preventing us from polling the preferred size for regular tabs. This check is not needed since the notifications need to be explictly enabled and they are only enabled by extensions related render views (and the app launcher). TEST=Open the app launcher, it should display correctly. BUG=None Review URL: http://codereview.chromium.org/1989002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc3
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h8
2 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index f4df639..1b5dcca 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -782,6 +782,9 @@ bool TabContents::NavigateToPendingEntry(
if (!dest_render_view_host)
return false; // Unable to create the desired render view host.
+ if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications())
+ dest_render_view_host->EnablePreferredSizeChangedMode();
+
// For security, we should never send non-DOM-UI URLs (other than about:blank)
// to a DOM UI renderer. Double check that here.
int enabled_bindings = dest_render_view_host->enabled_bindings();
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 2c153d2..9f80870 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -286,8 +286,14 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// Returns whether infobars are enabled. Overrideable by child classes.
virtual bool infobars_enabled() { return true; }
+ // Whether the renderer should report its preferred size when it changes by
+ // calling UpdatePreferredSize().
+ // Note that this is set when the RenderViewHost is created and cannot be
+ // changed after that.
+ virtual bool ShouldEnablePreferredSizeNotifications() { return false; }
+
// Notification that the preferred size of the contents has changed.
- // Only called if RenderViewHost::EnablePreferredSizeChangedMode() was called.
+ // Only called if ShouldEnablePreferredSizeNotifications() returns true.
virtual void UpdatePreferredSize(const gfx::Size& pref_size) {}
protected: