| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4501 RenderFrameDevToolsAgentHost::WebContentsCreated(this); | 4501 RenderFrameDevToolsAgentHost::WebContentsCreated(this); |
| 4502 } | 4502 } |
| 4503 | 4503 |
| 4504 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { | 4504 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { |
| 4505 if (rvh != GetRenderViewHost()) { | 4505 if (rvh != GetRenderViewHost()) { |
| 4506 // Don't notify the world, since this came from a renderer in the | 4506 // Don't notify the world, since this came from a renderer in the |
| 4507 // background. | 4507 // background. |
| 4508 return; | 4508 return; |
| 4509 } | 4509 } |
| 4510 | 4510 |
| 4511 RenderWidgetHostViewBase* rwhv = |
| 4512 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 4513 if (rwhv) |
| 4514 rwhv->SetMainFrameAXTreeID(GetMainFrame()->GetAXTreeID()); |
| 4515 |
| 4511 notify_disconnection_ = true; | 4516 notify_disconnection_ = true; |
| 4512 // TODO(avi): Remove. http://crbug.com/170921 | 4517 // TODO(avi): Remove. http://crbug.com/170921 |
| 4513 NotificationService::current()->Notify( | 4518 NotificationService::current()->Notify( |
| 4514 NOTIFICATION_WEB_CONTENTS_CONNECTED, | 4519 NOTIFICATION_WEB_CONTENTS_CONNECTED, |
| 4515 Source<WebContents>(this), | 4520 Source<WebContents>(this), |
| 4516 NotificationService::NoDetails()); | 4521 NotificationService::NoDetails()); |
| 4517 | 4522 |
| 4518 bool was_crashed = IsCrashed(); | 4523 bool was_crashed = IsCrashed(); |
| 4519 SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0); | 4524 SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0); |
| 4520 | 4525 |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 bool is_main_frame) { | 5066 bool is_main_frame) { |
| 5062 if (is_main_frame) { | 5067 if (is_main_frame) { |
| 5063 NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, | 5068 NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, |
| 5064 new_host->GetRenderViewHost()); | 5069 new_host->GetRenderViewHost()); |
| 5065 | 5070 |
| 5066 // Make sure the visible RVH reflects the new delegate's preferences. | 5071 // Make sure the visible RVH reflects the new delegate's preferences. |
| 5067 if (delegate_) | 5072 if (delegate_) |
| 5068 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 5073 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 5069 | 5074 |
| 5070 view_->RenderViewSwappedIn(new_host->GetRenderViewHost()); | 5075 view_->RenderViewSwappedIn(new_host->GetRenderViewHost()); |
| 5076 |
| 5077 RenderWidgetHostViewBase* rwhv = |
| 5078 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 5079 if (rwhv) |
| 5080 rwhv->SetMainFrameAXTreeID(GetMainFrame()->GetAXTreeID()); |
| 5071 } | 5081 } |
| 5072 | 5082 |
| 5073 NotifyFrameSwapped(old_host, new_host); | 5083 NotifyFrameSwapped(old_host, new_host); |
| 5074 } | 5084 } |
| 5075 | 5085 |
| 5076 void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager( | 5086 void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager( |
| 5077 RenderViewHost* old_host, | 5087 RenderViewHost* old_host, |
| 5078 RenderViewHost* new_host) { | 5088 RenderViewHost* new_host) { |
| 5079 NotifyViewSwapped(old_host, new_host); | 5089 NotifyViewSwapped(old_host, new_host); |
| 5080 } | 5090 } |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5567 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5577 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5568 if (!render_view_host) | 5578 if (!render_view_host) |
| 5569 continue; | 5579 continue; |
| 5570 render_view_host_set.insert(render_view_host); | 5580 render_view_host_set.insert(render_view_host); |
| 5571 } | 5581 } |
| 5572 for (RenderViewHost* render_view_host : render_view_host_set) | 5582 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5573 render_view_host->OnWebkitPreferencesChanged(); | 5583 render_view_host->OnWebkitPreferencesChanged(); |
| 5574 } | 5584 } |
| 5575 | 5585 |
| 5576 } // namespace content | 5586 } // namespace content |
| OLD | NEW |