| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #include "components/prefs/pref_service.h" | 77 #include "components/prefs/pref_service.h" |
| 78 #include "components/sessions/core/base_session_service_test_helper.h" | 78 #include "components/sessions/core/base_session_service_test_helper.h" |
| 79 #include "components/translate/core/browser/language_state.h" | 79 #include "components/translate/core/browser/language_state.h" |
| 80 #include "components/translate/core/common/language_detection_details.h" | 80 #include "components/translate/core/common/language_detection_details.h" |
| 81 #include "content/public/browser/favicon_status.h" | 81 #include "content/public/browser/favicon_status.h" |
| 82 #include "content/public/browser/host_zoom_map.h" | 82 #include "content/public/browser/host_zoom_map.h" |
| 83 #include "content/public/browser/interstitial_page.h" | 83 #include "content/public/browser/interstitial_page.h" |
| 84 #include "content/public/browser/interstitial_page_delegate.h" | 84 #include "content/public/browser/interstitial_page_delegate.h" |
| 85 #include "content/public/browser/navigation_entry.h" | 85 #include "content/public/browser/navigation_entry.h" |
| 86 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
| 87 #include "content/public/browser/reload_type.h" |
| 87 #include "content/public/browser/render_frame_host.h" | 88 #include "content/public/browser/render_frame_host.h" |
| 88 #include "content/public/browser/render_process_host.h" | 89 #include "content/public/browser/render_process_host.h" |
| 89 #include "content/public/browser/render_view_host.h" | 90 #include "content/public/browser/render_view_host.h" |
| 90 #include "content/public/browser/render_widget_host.h" | 91 #include "content/public/browser/render_widget_host.h" |
| 91 #include "content/public/browser/render_widget_host_view.h" | 92 #include "content/public/browser/render_widget_host_view.h" |
| 92 #include "content/public/browser/resource_context.h" | 93 #include "content/public/browser/resource_context.h" |
| 93 #include "content/public/browser/web_contents.h" | 94 #include "content/public/browser/web_contents.h" |
| 94 #include "content/public/browser/web_contents_observer.h" | 95 #include "content/public/browser/web_contents_observer.h" |
| 95 #include "content/public/common/frame_navigate_params.h" | 96 #include "content/public/common/frame_navigate_params.h" |
| 96 #include "content/public/common/renderer_preferences.h" | 97 #include "content/public/common/renderer_preferences.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Cache the size when RenderViewHost is first created. | 278 // Cache the size when RenderViewHost is first created. |
| 278 void RenderViewCreated(content::RenderViewHost* render_view_host) override { | 279 void RenderViewCreated(content::RenderViewHost* render_view_host) override { |
| 279 render_view_sizes_[render_view_host].rwhv_create_size = | 280 render_view_sizes_[render_view_host].rwhv_create_size = |
| 280 render_view_host->GetWidget()->GetView()->GetViewBounds().size(); | 281 render_view_host->GetWidget()->GetView()->GetViewBounds().size(); |
| 281 } | 282 } |
| 282 | 283 |
| 283 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry | 284 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry |
| 284 // is pending. | 285 // is pending. |
| 285 void DidStartNavigationToPendingEntry( | 286 void DidStartNavigationToPendingEntry( |
| 286 const GURL& url, | 287 const GURL& url, |
| 287 NavigationController::ReloadType reload_type) override { | 288 content::ReloadType reload_type) override { |
| 288 if (wcv_resize_insets_.IsEmpty()) | 289 if (wcv_resize_insets_.IsEmpty()) |
| 289 return; | 290 return; |
| 290 // Resizing the main browser window by |wcv_resize_insets_| will | 291 // Resizing the main browser window by |wcv_resize_insets_| will |
| 291 // automatically resize the WebContentsView by the same amount. | 292 // automatically resize the WebContentsView by the same amount. |
| 292 // Just resizing WebContentsView directly doesn't work on Linux, because the | 293 // Just resizing WebContentsView directly doesn't work on Linux, because the |
| 293 // next automatic layout of the browser window will resize WebContentsView | 294 // next automatic layout of the browser window will resize WebContentsView |
| 294 // back to the previous size. To make it consistent, resize main browser | 295 // back to the previous size. To make it consistent, resize main browser |
| 295 // window on all platforms. | 296 // window on all platforms. |
| 296 gfx::Rect bounds(browser_window_->GetBounds()); | 297 gfx::Rect bounds(browser_window_->GetBounds()); |
| 297 gfx::Size size(bounds.size()); | 298 gfx::Size size(bounds.size()); |
| (...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2847 Browser* browser = new Browser(params); | 2848 Browser* browser = new Browser(params); |
| 2848 gfx::Rect bounds = browser->window()->GetBounds(); | 2849 gfx::Rect bounds = browser->window()->GetBounds(); |
| 2849 | 2850 |
| 2850 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 2851 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
| 2851 // See https://crbug.com/567925. | 2852 // See https://crbug.com/567925. |
| 2852 EXPECT_GE(bounds.width(), 100); | 2853 EXPECT_GE(bounds.width(), 100); |
| 2853 EXPECT_EQ(122, bounds.height()); | 2854 EXPECT_EQ(122, bounds.height()); |
| 2854 browser->window()->Close(); | 2855 browser->window()->Close(); |
| 2855 } | 2856 } |
| 2856 } | 2857 } |
| OLD | NEW |