summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 00:33:33 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 00:33:33 +0000
commit0548c535089c52b722990abf03f3df375499034d (patch)
tree7b87e1b8e0dc8d1f705727f5e30599680cfe894f /content
parente7a2d749e769e50d1b9aa8114620cc839715c7e2 (diff)
downloadchromium_src-0548c535089c52b722990abf03f3df375499034d.zip
chromium_src-0548c535089c52b722990abf03f3df375499034d.tar.gz
chromium_src-0548c535089c52b722990abf03f3df375499034d.tar.bz2
Make panel adjust bounds per preferred size change notification on Windows.
BUG=none TEST=new browser test Review URL: http://codereview.chromium.org/7537030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/render_view_host.cc5
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.h6
-rw-r--r--content/browser/tab_contents/interstitial_page.cc5
-rw-r--r--content/browser/tab_contents/tab_contents.cc5
-rw-r--r--content/browser/tab_contents/tab_contents.h1
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.cc4
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.h4
-rw-r--r--content/browser/tab_contents/tab_contents_view.h3
-rw-r--r--content/test/test_tab_contents_view.cc3
-rw-r--r--content/test/test_tab_contents_view.h1
10 files changed, 18 insertions, 19 deletions
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index 59cc504..f128832 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -1003,10 +1003,7 @@ void RenderViewHost::OnMsgOpenURL(const GURL& url,
void RenderViewHost::OnMsgDidContentsPreferredSizeChange(
const gfx::Size& new_size) {
- RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
- if (!view)
- return;
- view->UpdatePreferredSize(new_size);
+ delegate_->UpdatePreferredSize(new_size);
}
void RenderViewHost::OnMsgDidChangeScrollbarsForMainFrame(
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index cda683b3..9efb922 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -150,9 +150,6 @@ class RenderViewHostDelegate : public IPC::Channel::Listener {
// retrieved by doing a Shift-Tab.
virtual void TakeFocus(bool reverse) = 0;
- // The contents' preferred size changed.
- virtual void UpdatePreferredSize(const gfx::Size& pref_size) = 0;
-
protected:
virtual ~View() {}
};
@@ -375,6 +372,9 @@ class RenderViewHostDelegate : public IPC::Channel::Listener {
// Notification that the page wants to go into or out of fullscreen mode.
virtual void ToggleFullscreenMode(bool enter_fullscreen) {}
+ // The contents' preferred size changed.
+ virtual void UpdatePreferredSize(const gfx::Size& pref_size) {}
+
protected:
virtual ~RenderViewHostDelegate() {}
};
diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc
index 3e801c7..6f0f271 100644
--- a/content/browser/tab_contents/interstitial_page.cc
+++ b/content/browser/tab_contents/interstitial_page.cc
@@ -117,7 +117,6 @@ class InterstitialPage::InterstitialPageRVHViewDelegate
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update);
- virtual void UpdatePreferredSize(const gfx::Size& pref_size);
private:
InterstitialPage* interstitial_page_;
@@ -654,10 +653,6 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::UpdateDragCursor(
void InterstitialPage::InterstitialPageRVHViewDelegate::GotFocus() {
}
-void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredSize(
- const gfx::Size& pref_size) {
-}
-
void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus(
bool reverse) {
if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 30eaa24..302f99f 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -516,6 +516,11 @@ void TabContents::ToggleFullscreenMode(bool enter_fullscreen) {
delegate_->ToggleFullscreenModeForTab(this, enter_fullscreen);
}
+void TabContents::UpdatePreferredSize(const gfx::Size& pref_size) {
+ if (delegate_)
+ delegate_->UpdatePreferredSize(this, pref_size);
+}
+
void TabContents::ShowContents() {
RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
if (rwhv)
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 7b46ca6..072bc29 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -725,6 +725,7 @@ class TabContents : public PageNavigator,
virtual void RunFileChooser(RenderViewHost* render_view_host,
const ViewHostMsg_RunFileChooser_Params& params);
virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
+ virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
// RenderViewHostManager::Delegate -------------------------------------------
diff --git a/content/browser/tab_contents/tab_contents_delegate.cc b/content/browser/tab_contents/tab_contents_delegate.cc
index 8663f91..bd8e9ff 100644
--- a/content/browser/tab_contents/tab_contents_delegate.cc
+++ b/content/browser/tab_contents/tab_contents_delegate.cc
@@ -329,6 +329,10 @@ void TabContentsDelegate::CrashedPlugin(TabContents* tab,
const FilePath& plugin_path) {
}
+void TabContentsDelegate::UpdatePreferredSize(TabContents* source,
+ const gfx::Size& pref_size) {
+}
+
TabContentsDelegate::~TabContentsDelegate() {
while (!attached_contents_.empty()) {
TabContents* tab_contents = *attached_contents_.begin();
diff --git a/content/browser/tab_contents/tab_contents_delegate.h b/content/browser/tab_contents/tab_contents_delegate.h
index d284110..5a69298a 100644
--- a/content/browser/tab_contents/tab_contents_delegate.h
+++ b/content/browser/tab_contents/tab_contents_delegate.h
@@ -352,6 +352,10 @@ class TabContentsDelegate {
// Notification that a plugin has crashed.
virtual void CrashedPlugin(TabContents* tab, const FilePath& plugin_path);
+ // Invoked when the preferred size of the contents has been changed.
+ virtual void UpdatePreferredSize(TabContents* source,
+ const gfx::Size& pref_size);
+
protected:
virtual ~TabContentsDelegate();
diff --git a/content/browser/tab_contents/tab_contents_view.h b/content/browser/tab_contents/tab_contents_view.h
index f5c58be..0726150 100644
--- a/content/browser/tab_contents/tab_contents_view.h
+++ b/content/browser/tab_contents/tab_contents_view.h
@@ -98,9 +98,6 @@ class TabContentsView : public RenderViewHostDelegate::View {
// invoked, SetInitialFocus is invoked.
virtual void RestoreFocus() = 0;
- // Notification that the preferred size of the contents has changed.
- virtual void UpdatePreferredSize(const gfx::Size& pref_size) = 0;
-
// If we try to close the tab while a drag is in progress, we crash. These
// methods allow the tab contents to determine if a drag is in progress and
// postpone the tab closing.
diff --git a/content/test/test_tab_contents_view.cc b/content/test/test_tab_contents_view.cc
index a60552b..70bbba2 100644
--- a/content/test/test_tab_contents_view.cc
+++ b/content/test/test_tab_contents_view.cc
@@ -62,9 +62,6 @@ void TestTabContentsView::GotFocus() {
void TestTabContentsView::TakeFocus(bool reverse) {
}
-void TestTabContentsView::UpdatePreferredSize(const gfx::Size& pref_size) {
-}
-
void TestTabContentsView::CreateView(const gfx::Size& initial_size) {
}
diff --git a/content/test/test_tab_contents_view.h b/content/test/test_tab_contents_view.h
index e70e0bc..92d64b9 100644
--- a/content/test/test_tab_contents_view.h
+++ b/content/test/test_tab_contents_view.h
@@ -42,7 +42,6 @@ class TestTabContentsView : public TabContentsView {
virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE;
virtual void GotFocus() OVERRIDE;
virtual void TakeFocus(bool reverse) OVERRIDE;
- virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
// TabContentsView:
virtual void CreateView(const gfx::Size& initial_size) OVERRIDE;