Chromium Code Reviews| Index: chrome/browser/ui/browser_browsertest.cc |
| diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc |
| index 7f6fa033d5c58ddc9102abb1a97b718c9ba352ba..0fd477c7073a0737e50615f004a0262c4af0aa38 100644 |
| --- a/chrome/browser/ui/browser_browsertest.cc |
| +++ b/chrome/browser/ui/browser_browsertest.cc |
| @@ -283,11 +283,23 @@ class RenderViewSizeObserver : public content::WebContentsObserver { |
| render_view_host->GetWidget()->GetView()->GetViewBounds().size(); |
| } |
| + void DidStartNavigationToPendingEntry( |
| + const GURL& url, |
| + content::ReloadType reload_type) override { |
| + // TODO: remove this method when PlzNavigate is turned on by default. |
| + if (!content::IsBrowserSideNavigationEnabled()) |
|
clamy
2017/01/18 14:33:34
Does it fail without this if PlzNavigate isn't ena
jam
2017/01/18 16:35:21
Yep, it fails because both methods are called
clamy
2017/01/19 14:59:37
Acknowledged.
|
| + Resize(); |
| + } |
| + |
| // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry |
| // is pending. |
| - void DidStartNavigationToPendingEntry( |
| - const GURL& url, |
| - content::ReloadType reload_type) override { |
| + void DidStartNavigation( |
| + content::NavigationHandle* navigation_handle) override { |
| + if (content::IsBrowserSideNavigationEnabled()) |
| + Resize(); |
| + } |
| + |
| + void Resize() { |
| if (wcv_resize_insets_.IsEmpty()) |
| return; |
| // Resizing the main browser window by |wcv_resize_insets_| will |
| @@ -327,7 +339,7 @@ class RenderViewSizeObserver : public content::WebContentsObserver { |
| typedef std::map<content::RenderViewHost*, Sizes> RenderViewSizes; |
| RenderViewSizes render_view_sizes_; |
| // Enlarge WebContentsView by this size insets in |
| - // DidStartNavigationToPendingEntry. |
| + // DidStartNavigation. |
| gfx::Size wcv_resize_insets_; |
| BrowserWindow* browser_window_; // Weak ptr. |