OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Cache the size when RenderViewHost is first created. | 277 // Cache the size when RenderViewHost is first created. |
278 void RenderViewCreated(content::RenderViewHost* render_view_host) override { | 278 void RenderViewCreated(content::RenderViewHost* render_view_host) override { |
279 render_view_sizes_[render_view_host].rwhv_create_size = | 279 render_view_sizes_[render_view_host].rwhv_create_size = |
280 render_view_host->GetWidget()->GetView()->GetViewBounds().size(); | 280 render_view_host->GetWidget()->GetView()->GetViewBounds().size(); |
281 } | 281 } |
282 | 282 |
283 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry | 283 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry |
284 // is pending. | 284 // is pending. |
285 void DidStartNavigationToPendingEntry( | 285 void DidStartNavigationToPendingEntry( |
286 const GURL& url, | 286 const GURL& url, |
287 NavigationController::ReloadType reload_type) override { | 287 content::ReloadType reload_type) override { |
288 if (wcv_resize_insets_.IsEmpty()) | 288 if (wcv_resize_insets_.IsEmpty()) |
289 return; | 289 return; |
290 // Resizing the main browser window by |wcv_resize_insets_| will | 290 // Resizing the main browser window by |wcv_resize_insets_| will |
291 // automatically resize the WebContentsView by the same amount. | 291 // automatically resize the WebContentsView by the same amount. |
292 // Just resizing WebContentsView directly doesn't work on Linux, because the | 292 // Just resizing WebContentsView directly doesn't work on Linux, because the |
293 // next automatic layout of the browser window will resize WebContentsView | 293 // next automatic layout of the browser window will resize WebContentsView |
294 // back to the previous size. To make it consistent, resize main browser | 294 // back to the previous size. To make it consistent, resize main browser |
295 // window on all platforms. | 295 // window on all platforms. |
296 gfx::Rect bounds(browser_window_->GetBounds()); | 296 gfx::Rect bounds(browser_window_->GetBounds()); |
297 gfx::Size size(bounds.size()); | 297 gfx::Size size(bounds.size()); |
(...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2847 Browser* browser = new Browser(params); | 2847 Browser* browser = new Browser(params); |
2848 gfx::Rect bounds = browser->window()->GetBounds(); | 2848 gfx::Rect bounds = browser->window()->GetBounds(); |
2849 | 2849 |
2850 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 2850 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
2851 // See https://crbug.com/567925. | 2851 // See https://crbug.com/567925. |
2852 EXPECT_GE(bounds.width(), 100); | 2852 EXPECT_GE(bounds.width(), 100); |
2853 EXPECT_EQ(122, bounds.height()); | 2853 EXPECT_EQ(122, bounds.height()); |
2854 browser->window()->Close(); | 2854 browser->window()->Close(); |
2855 } | 2855 } |
2856 } | 2856 } |
OLD | NEW |