| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 BrowserContext* browser_context, | 229 BrowserContext* browser_context, |
| 230 SiteInstance* site_instance, | 230 SiteInstance* site_instance, |
| 231 int routing_id, | 231 int routing_id, |
| 232 const WebContents* base_web_contents, | 232 const WebContents* base_web_contents, |
| 233 SessionStorageNamespace* session_storage_namespace) { | 233 SessionStorageNamespace* session_storage_namespace) { |
| 234 return new WebContentsImpl( | 234 return new WebContentsImpl( |
| 235 browser_context, | 235 browser_context, |
| 236 site_instance, | 236 site_instance, |
| 237 routing_id, | 237 routing_id, |
| 238 static_cast<const WebContentsImpl*>(base_web_contents), | 238 static_cast<const WebContentsImpl*>(base_web_contents), |
| 239 NULL, |
| 239 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace)); | 240 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace)); |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| 243 // WebContentsImpl ------------------------------------------------------------- | 244 // WebContentsImpl ------------------------------------------------------------- |
| 244 | 245 |
| 245 WebContentsImpl::WebContentsImpl( | 246 WebContentsImpl::WebContentsImpl( |
| 246 content::BrowserContext* browser_context, | 247 content::BrowserContext* browser_context, |
| 247 SiteInstance* site_instance, | 248 SiteInstance* site_instance, |
| 248 int routing_id, | 249 int routing_id, |
| 249 const WebContentsImpl* base_web_contents, | 250 const WebContentsImpl* base_web_contents, |
| 251 WebContentsImpl* opener, |
| 250 SessionStorageNamespaceImpl* session_storage_namespace) | 252 SessionStorageNamespaceImpl* session_storage_namespace) |
| 251 : delegate_(NULL), | 253 : delegate_(NULL), |
| 252 ALLOW_THIS_IN_INITIALIZER_LIST(controller_( | 254 ALLOW_THIS_IN_INITIALIZER_LIST(controller_( |
| 253 this, browser_context, session_storage_namespace)), | 255 this, browser_context, session_storage_namespace)), |
| 256 opener_(opener), |
| 254 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), | 257 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), |
| 255 is_loading_(false), | 258 is_loading_(false), |
| 256 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 259 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
| 257 crashed_error_code_(0), | 260 crashed_error_code_(0), |
| 258 waiting_for_response_(false), | 261 waiting_for_response_(false), |
| 259 load_state_(net::LOAD_STATE_IDLE, string16()), | 262 load_state_(net::LOAD_STATE_IDLE, string16()), |
| 260 upload_size_(0), | 263 upload_size_(0), |
| 261 upload_position_(0), | 264 upload_position_(0), |
| 262 displayed_insecure_content_(false), | 265 displayed_insecure_content_(false), |
| 263 capturing_contents_(false), | 266 capturing_contents_(false), |
| 264 is_being_destroyed_(false), | 267 is_being_destroyed_(false), |
| 265 notify_disconnection_(false), | 268 notify_disconnection_(false), |
| 266 dialog_creator_(NULL), | 269 dialog_creator_(NULL), |
| 267 #if defined(OS_WIN) | 270 #if defined(OS_WIN) |
| 268 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), | 271 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), |
| 269 #endif | 272 #endif |
| 270 is_showing_before_unload_dialog_(false), | 273 is_showing_before_unload_dialog_(false), |
| 271 opener_web_ui_type_(WebUI::kNoWebUI), | 274 opener_web_ui_type_(WebUI::kNoWebUI), |
| 272 closed_by_user_gesture_(false), | 275 closed_by_user_gesture_(false), |
| 273 minimum_zoom_percent_( | 276 minimum_zoom_percent_( |
| 274 static_cast<int>(content::kMinimumZoomFactor * 100)), | 277 static_cast<int>(content::kMinimumZoomFactor * 100)), |
| 275 maximum_zoom_percent_( | 278 maximum_zoom_percent_( |
| 276 static_cast<int>(content::kMaximumZoomFactor * 100)), | 279 static_cast<int>(content::kMaximumZoomFactor * 100)), |
| 277 temporary_zoom_settings_(false), | 280 temporary_zoom_settings_(false), |
| 278 content_restrictions_(0), | 281 content_restrictions_(0), |
| 279 view_type_(content::VIEW_TYPE_WEB_CONTENTS), | 282 view_type_(content::VIEW_TYPE_WEB_CONTENTS), |
| 280 has_opener_(false), | |
| 281 color_chooser_(NULL) { | 283 color_chooser_(NULL) { |
| 282 render_manager_.Init(browser_context, site_instance, routing_id); | 284 render_manager_.Init(browser_context, site_instance, routing_id); |
| 283 | 285 |
| 284 view_.reset(content::GetContentClient()->browser()-> | 286 view_.reset(content::GetContentClient()->browser()-> |
| 285 OverrideCreateWebContentsView(this)); | 287 OverrideCreateWebContentsView(this)); |
| 286 if (!view_.get()) { | 288 if (!view_.get()) { |
| 287 content::WebContentsViewDelegate* delegate = | 289 content::WebContentsViewDelegate* delegate = |
| 288 content::GetContentClient()->browser()->GetWebContentsViewDelegate( | 290 content::GetContentClient()->browser()->GetWebContentsViewDelegate( |
| 289 this); | 291 this); |
| 290 #if defined(USE_AURA) | 292 #if defined(USE_AURA) |
| 291 view_.reset(new WebContentsViewAura(this, delegate)); | 293 view_.reset(new WebContentsViewAura(this, delegate)); |
| 292 #elif defined(OS_WIN) | 294 #elif defined(OS_WIN) |
| 293 view_.reset(new WebContentsViewWin(this, delegate)); | 295 view_.reset(new WebContentsViewWin(this, delegate)); |
| 294 #elif defined(TOOLKIT_GTK) | 296 #elif defined(TOOLKIT_GTK) |
| 295 view_.reset(new content::WebContentsViewGtk(this, delegate)); | 297 view_.reset(new content::WebContentsViewGtk(this, delegate)); |
| 296 #elif defined(OS_MACOSX) | 298 #elif defined(OS_MACOSX) |
| 297 view_.reset(web_contents_view_mac::CreateWebContentsView(this, delegate)); | 299 view_.reset(web_contents_view_mac::CreateWebContentsView(this, delegate)); |
| 298 #elif defined(OS_ANDROID) | 300 #elif defined(OS_ANDROID) |
| 299 view_.reset(new WebContentsViewAndroid(this)); | 301 view_.reset(new WebContentsViewAndroid(this)); |
| 300 #endif | 302 #endif |
| 301 (void)delegate; | 303 (void)delegate; |
| 302 } | 304 } |
| 303 CHECK(view_.get()); | 305 CHECK(view_.get()); |
| 304 | 306 |
| 305 // We have the initial size of the view be based on the size of the view of | 307 // We have the initial size of the view be based on the size of the view of |
| 306 // the passed in WebContents. | 308 // the passed in WebContents. |
| 307 view_->CreateView(base_web_contents ? | 309 view_->CreateView(base_web_contents ? |
| 308 base_web_contents->GetView()->GetContainerSize() : gfx::Size()); | 310 base_web_contents->GetView()->GetContainerSize() : gfx::Size()); |
| 309 | 311 |
| 312 // Listen for whether our opener gets destroyed. |
| 313 if (opener_) { |
| 314 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 315 content::Source<WebContents>(opener_)); |
| 316 } |
| 317 |
| 310 #if defined(ENABLE_JAVA_BRIDGE) | 318 #if defined(ENABLE_JAVA_BRIDGE) |
| 311 java_bridge_dispatcher_host_manager_.reset( | 319 java_bridge_dispatcher_host_manager_.reset( |
| 312 new JavaBridgeDispatcherHostManager(this)); | 320 new JavaBridgeDispatcherHostManager(this)); |
| 313 #endif | 321 #endif |
| 314 | 322 |
| 315 browser_plugin_web_contents_observer_.reset( | 323 browser_plugin_web_contents_observer_.reset( |
| 316 new content::BrowserPluginWebContentsObserver(this)); | 324 new content::BrowserPluginWebContentsObserver(this)); |
| 317 } | 325 } |
| 318 | 326 |
| 319 WebContentsImpl::~WebContentsImpl() { | 327 WebContentsImpl::~WebContentsImpl() { |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 !static_cast<RenderViewHostImpl*>( | 909 !static_cast<RenderViewHostImpl*>( |
| 902 GetRenderViewHost())->SuddenTerminationAllowed(); | 910 GetRenderViewHost())->SuddenTerminationAllowed(); |
| 903 } | 911 } |
| 904 | 912 |
| 905 void WebContentsImpl::Stop() { | 913 void WebContentsImpl::Stop() { |
| 906 render_manager_.Stop(); | 914 render_manager_.Stop(); |
| 907 FOR_EACH_OBSERVER(WebContentsObserver, observers_, StopNavigation()); | 915 FOR_EACH_OBSERVER(WebContentsObserver, observers_, StopNavigation()); |
| 908 } | 916 } |
| 909 | 917 |
| 910 WebContents* WebContentsImpl::Clone() { | 918 WebContents* WebContentsImpl::Clone() { |
| 911 // We create a new SiteInstance so that the new tab won't share processes | 919 // We use our current SiteInstance since the cloned entry will use it anyway. |
| 912 // with the old one. This can be changed in the future if we need it to share | 920 // We pass |this| for the |base_web_contents| to size the view correctly, and |
| 913 // processes for some reason. | 921 // our own opener so that the cloned page can access it if it was before. |
| 914 WebContentsImpl* tc = new WebContentsImpl( | 922 WebContentsImpl* tc = new WebContentsImpl( |
| 915 GetBrowserContext(), | 923 GetBrowserContext(), GetSiteInstance(), |
| 916 SiteInstance::Create(GetBrowserContext()), | 924 MSG_ROUTING_NONE, this, opener_, NULL); |
| 917 MSG_ROUTING_NONE, this, NULL); | |
| 918 tc->GetControllerImpl().CopyStateFrom(controller_); | 925 tc->GetControllerImpl().CopyStateFrom(controller_); |
| 919 return tc; | 926 return tc; |
| 920 } | 927 } |
| 921 | 928 |
| 922 void WebContentsImpl::AddNewContents(WebContents* new_contents, | 929 void WebContentsImpl::AddNewContents(WebContents* new_contents, |
| 923 WindowOpenDisposition disposition, | 930 WindowOpenDisposition disposition, |
| 924 const gfx::Rect& initial_pos, | 931 const gfx::Rect& initial_pos, |
| 925 bool user_gesture) { | 932 bool user_gesture) { |
| 926 if (!delegate_) | 933 if (!delegate_) |
| 927 return; | 934 return; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 939 } | 946 } |
| 940 | 947 |
| 941 void WebContentsImpl::GetContainerBounds(gfx::Rect* out) const { | 948 void WebContentsImpl::GetContainerBounds(gfx::Rect* out) const { |
| 942 view_->GetContainerBounds(out); | 949 view_->GetContainerBounds(out); |
| 943 } | 950 } |
| 944 | 951 |
| 945 void WebContentsImpl::Focus() { | 952 void WebContentsImpl::Focus() { |
| 946 view_->Focus(); | 953 view_->Focus(); |
| 947 } | 954 } |
| 948 | 955 |
| 956 void WebContentsImpl::Observe(int type, |
| 957 const content::NotificationSource& source, |
| 958 const content::NotificationDetails& details) { |
| 959 switch (type) { |
| 960 case content::NOTIFICATION_WEB_CONTENTS_DESTROYED: |
| 961 OnWebContentsDestroyed( |
| 962 content::Source<content::WebContents>(source).ptr()); |
| 963 break; |
| 964 default: |
| 965 NOTREACHED(); |
| 966 } |
| 967 } |
| 968 |
| 969 void WebContentsImpl::OnWebContentsDestroyed(WebContents* web_contents) { |
| 970 // Clear the opener if it has been closed. |
| 971 if (web_contents == opener_) { |
| 972 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 973 content::Source<WebContents>(opener_)); |
| 974 opener_ = NULL; |
| 975 } |
| 976 } |
| 977 |
| 949 void WebContentsImpl::AddObserver(WebContentsObserver* observer) { | 978 void WebContentsImpl::AddObserver(WebContentsObserver* observer) { |
| 950 observers_.AddObserver(observer); | 979 observers_.AddObserver(observer); |
| 951 } | 980 } |
| 952 | 981 |
| 953 void WebContentsImpl::RemoveObserver(WebContentsObserver* observer) { | 982 void WebContentsImpl::RemoveObserver(WebContentsObserver* observer) { |
| 954 observers_.RemoveObserver(observer); | 983 observers_.RemoveObserver(observer); |
| 955 } | 984 } |
| 956 | 985 |
| 957 void WebContentsImpl::Activate() { | 986 void WebContentsImpl::Activate() { |
| 958 if (delegate_) | 987 if (delegate_) |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 return render_manager_.pending_web_ui(); | 1418 return render_manager_.pending_web_ui(); |
| 1390 return render_manager_.web_ui(); | 1419 return render_manager_.web_ui(); |
| 1391 } | 1420 } |
| 1392 | 1421 |
| 1393 bool WebContentsImpl::GotResponseToLockMouseRequest(bool allowed) { | 1422 bool WebContentsImpl::GotResponseToLockMouseRequest(bool allowed) { |
| 1394 return GetRenderViewHost() ? | 1423 return GetRenderViewHost() ? |
| 1395 GetRenderViewHostImpl()->GotResponseToLockMouseRequest(allowed) : false; | 1424 GetRenderViewHostImpl()->GotResponseToLockMouseRequest(allowed) : false; |
| 1396 } | 1425 } |
| 1397 | 1426 |
| 1398 bool WebContentsImpl::HasOpener() const { | 1427 bool WebContentsImpl::HasOpener() const { |
| 1399 return has_opener_; | 1428 return opener_ != NULL; |
| 1400 } | 1429 } |
| 1401 | 1430 |
| 1402 void WebContentsImpl::DidChooseColorInColorChooser(int color_chooser_id, | 1431 void WebContentsImpl::DidChooseColorInColorChooser(int color_chooser_id, |
| 1403 SkColor color) { | 1432 SkColor color) { |
| 1404 GetRenderViewHost()->Send(new ViewMsg_DidChooseColorResponse( | 1433 GetRenderViewHost()->Send(new ViewMsg_DidChooseColorResponse( |
| 1405 GetRenderViewHost()->GetRoutingID(), color_chooser_id, color)); | 1434 GetRenderViewHost()->GetRoutingID(), color_chooser_id, color)); |
| 1406 } | 1435 } |
| 1407 | 1436 |
| 1408 void WebContentsImpl::DidEndColorChooser(int color_chooser_id) { | 1437 void WebContentsImpl::DidEndColorChooser(int color_chooser_id) { |
| 1409 GetRenderViewHost()->Send(new ViewMsg_DidEndColorChooser( | 1438 GetRenderViewHost()->Send(new ViewMsg_DidEndColorChooser( |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1981 return view_type_; | 2010 return view_type_; |
| 1982 } | 2011 } |
| 1983 | 2012 |
| 1984 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const { | 2013 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const { |
| 1985 if (delegate_) | 2014 if (delegate_) |
| 1986 return delegate_->GetRootWindowResizerRect(); | 2015 return delegate_->GetRootWindowResizerRect(); |
| 1987 return gfx::Rect(); | 2016 return gfx::Rect(); |
| 1988 } | 2017 } |
| 1989 | 2018 |
| 1990 void WebContentsImpl::RenderViewCreated(RenderViewHost* render_view_host) { | 2019 void WebContentsImpl::RenderViewCreated(RenderViewHost* render_view_host) { |
| 2020 // Don't send notifications if we are just creating a swapped-out RVH for |
| 2021 // the opener chain. These won't be used for view-source or WebUI, so it's |
| 2022 // ok to return early. |
| 2023 if (static_cast<RenderViewHostImpl*>(render_view_host)->is_swapped_out()) |
| 2024 return; |
| 2025 |
| 1991 content::NotificationService::current()->Notify( | 2026 content::NotificationService::current()->Notify( |
| 1992 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, | 2027 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, |
| 1993 content::Source<WebContents>(this), | 2028 content::Source<WebContents>(this), |
| 1994 content::Details<RenderViewHost>(render_view_host)); | 2029 content::Details<RenderViewHost>(render_view_host)); |
| 1995 NavigationEntry* entry = controller_.GetActiveEntry(); | 2030 NavigationEntry* entry = controller_.GetActiveEntry(); |
| 1996 if (!entry) | 2031 if (!entry) |
| 1997 return; | 2032 return; |
| 1998 | 2033 |
| 1999 // When we're creating views, we're still doing initial setup, so we always | 2034 // When we're creating views, we're still doing initial setup, so we always |
| 2000 // use the pending Web UI rather than any possibly existing committed one. | 2035 // use the pending Web UI rather than any possibly existing committed one. |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2528 // later. In case of tab duplication this resizing to 0x0 prevents setting | 2563 // later. In case of tab duplication this resizing to 0x0 prevents setting |
| 2529 // normal size later so just ignore it. | 2564 // normal size later so just ignore it. |
| 2530 if (!size.IsEmpty()) | 2565 if (!size.IsEmpty()) |
| 2531 view_->SizeContents(size); | 2566 view_->SizeContents(size); |
| 2532 } | 2567 } |
| 2533 | 2568 |
| 2534 void WebContentsImpl::NotifySwappedFromRenderManager() { | 2569 void WebContentsImpl::NotifySwappedFromRenderManager() { |
| 2535 NotifySwapped(); | 2570 NotifySwapped(); |
| 2536 } | 2571 } |
| 2537 | 2572 |
| 2573 int WebContentsImpl::CreateOpenerRenderViewsForRenderManager( |
| 2574 SiteInstance* instance) { |
| 2575 if (!opener_) |
| 2576 return MSG_ROUTING_NONE; |
| 2577 |
| 2578 // Recursively create RenderViews for anything else in the opener chain. |
| 2579 return opener_->CreateOpenerRenderViews(instance); |
| 2580 } |
| 2581 |
| 2582 int WebContentsImpl::CreateOpenerRenderViews(SiteInstance* instance) { |
| 2583 int opener_route_id = MSG_ROUTING_NONE; |
| 2584 |
| 2585 // If this tab has an opener, ensure it has a RenderView in the given |
| 2586 // SiteInstance as well. |
| 2587 if (opener_) |
| 2588 opener_route_id = opener_->CreateOpenerRenderViews(instance); |
| 2589 |
| 2590 // Create a swapped out RenderView in the given SiteInstance if none exists, |
| 2591 // setting its opener to the given route_id. Return the new view's route_id. |
| 2592 return render_manager_.CreateRenderView(instance, opener_route_id, true); |
| 2593 } |
| 2594 |
| 2538 NavigationControllerImpl& WebContentsImpl::GetControllerForRenderManager() { | 2595 NavigationControllerImpl& WebContentsImpl::GetControllerForRenderManager() { |
| 2539 return GetControllerImpl(); | 2596 return GetControllerImpl(); |
| 2540 } | 2597 } |
| 2541 | 2598 |
| 2542 WebUIImpl* WebContentsImpl::CreateWebUIForRenderManager(const GURL& url) { | 2599 WebUIImpl* WebContentsImpl::CreateWebUIForRenderManager(const GURL& url) { |
| 2543 return static_cast<WebUIImpl*>(CreateWebUI(url)); | 2600 return static_cast<WebUIImpl*>(CreateWebUI(url)); |
| 2544 } | 2601 } |
| 2545 | 2602 |
| 2546 NavigationEntry* | 2603 NavigationEntry* |
| 2547 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { | 2604 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { |
| 2548 return controller_.GetLastCommittedEntry(); | 2605 return controller_.GetLastCommittedEntry(); |
| 2549 } | 2606 } |
| 2550 | 2607 |
| 2551 bool WebContentsImpl::CreateRenderViewForRenderManager( | 2608 bool WebContentsImpl::CreateRenderViewForRenderManager( |
| 2552 RenderViewHost* render_view_host) { | 2609 RenderViewHost* render_view_host, int opener_route_id) { |
| 2553 // Can be NULL during tests. | 2610 // Can be NULL during tests. |
| 2554 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); | 2611 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); |
| 2555 | 2612 |
| 2556 // Now that the RenderView has been created, we need to tell it its size. | 2613 // Now that the RenderView has been created, we need to tell it its size. |
| 2557 if (rwh_view) | 2614 if (rwh_view) |
| 2558 rwh_view->SetSize(view_->GetContainerSize()); | 2615 rwh_view->SetSize(view_->GetContainerSize()); |
| 2559 | 2616 |
| 2560 // Make sure we use the correct starting page_id in the new RenderView. | 2617 // Make sure we use the correct starting page_id in the new RenderView. |
| 2561 UpdateMaxPageIDIfNecessary(render_view_host); | 2618 UpdateMaxPageIDIfNecessary(render_view_host); |
| 2562 int32 max_page_id = | 2619 int32 max_page_id = |
| 2563 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); | 2620 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); |
| 2564 | 2621 |
| 2565 if (!static_cast<RenderViewHostImpl*>( | 2622 if (!static_cast<RenderViewHostImpl*>( |
| 2566 render_view_host)->CreateRenderView(string16(), max_page_id)) | 2623 render_view_host)->CreateRenderView(string16(), opener_route_id, |
| 2624 max_page_id)) { |
| 2567 return false; | 2625 return false; |
| 2626 } |
| 2568 | 2627 |
| 2569 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 2628 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 2570 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on | 2629 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on |
| 2571 // linux. See crbug.com/83941. | 2630 // linux. See crbug.com/83941. |
| 2572 if (rwh_view) { | 2631 if (rwh_view) { |
| 2573 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) | 2632 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) |
| 2574 render_widget_host->WasResized(); | 2633 render_widget_host->WasResized(); |
| 2575 } | 2634 } |
| 2576 #endif | 2635 #endif |
| 2577 | 2636 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2685 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2627 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2686 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2628 // Can be NULL during tests. | 2687 // Can be NULL during tests. |
| 2629 if (rwh_view) | 2688 if (rwh_view) |
| 2630 rwh_view->SetSize(GetView()->GetContainerSize()); | 2689 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2631 } | 2690 } |
| 2632 | 2691 |
| 2633 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2692 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2634 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2693 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2635 } | 2694 } |
| OLD | NEW |