| 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 4443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4454 RenderFrameDevToolsAgentHost::WebContentsCreated(this); | 4454 RenderFrameDevToolsAgentHost::WebContentsCreated(this); |
| 4455 } | 4455 } |
| 4456 | 4456 |
| 4457 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { | 4457 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { |
| 4458 if (rvh != GetRenderViewHost()) { | 4458 if (rvh != GetRenderViewHost()) { |
| 4459 // Don't notify the world, since this came from a renderer in the | 4459 // Don't notify the world, since this came from a renderer in the |
| 4460 // background. | 4460 // background. |
| 4461 return; | 4461 return; |
| 4462 } | 4462 } |
| 4463 | 4463 |
| 4464 RenderWidgetHostViewBase* rwhv = |
| 4465 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 4466 if (rwhv) |
| 4467 rwhv->SetMainFrameAXTreeID(GetMainFrame()->GetAXTreeID()); |
| 4468 |
| 4464 notify_disconnection_ = true; | 4469 notify_disconnection_ = true; |
| 4465 // TODO(avi): Remove. http://crbug.com/170921 | 4470 // TODO(avi): Remove. http://crbug.com/170921 |
| 4466 NotificationService::current()->Notify( | 4471 NotificationService::current()->Notify( |
| 4467 NOTIFICATION_WEB_CONTENTS_CONNECTED, | 4472 NOTIFICATION_WEB_CONTENTS_CONNECTED, |
| 4468 Source<WebContents>(this), | 4473 Source<WebContents>(this), |
| 4469 NotificationService::NoDetails()); | 4474 NotificationService::NoDetails()); |
| 4470 | 4475 |
| 4471 bool was_crashed = IsCrashed(); | 4476 bool was_crashed = IsCrashed(); |
| 4472 SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0); | 4477 SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0); |
| 4473 | 4478 |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5013 bool is_main_frame) { | 5018 bool is_main_frame) { |
| 5014 if (is_main_frame) { | 5019 if (is_main_frame) { |
| 5015 NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, | 5020 NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, |
| 5016 new_host->GetRenderViewHost()); | 5021 new_host->GetRenderViewHost()); |
| 5017 | 5022 |
| 5018 // Make sure the visible RVH reflects the new delegate's preferences. | 5023 // Make sure the visible RVH reflects the new delegate's preferences. |
| 5019 if (delegate_) | 5024 if (delegate_) |
| 5020 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 5025 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 5021 | 5026 |
| 5022 view_->RenderViewSwappedIn(new_host->GetRenderViewHost()); | 5027 view_->RenderViewSwappedIn(new_host->GetRenderViewHost()); |
| 5028 |
| 5029 RenderWidgetHostViewBase* rwhv = |
| 5030 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| 5031 if (rwhv) |
| 5032 rwhv->SetMainFrameAXTreeID(GetMainFrame()->GetAXTreeID()); |
| 5023 } | 5033 } |
| 5024 | 5034 |
| 5025 NotifyFrameSwapped(old_host, new_host); | 5035 NotifyFrameSwapped(old_host, new_host); |
| 5026 } | 5036 } |
| 5027 | 5037 |
| 5028 void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager( | 5038 void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager( |
| 5029 RenderViewHost* old_host, | 5039 RenderViewHost* old_host, |
| 5030 RenderViewHost* new_host) { | 5040 RenderViewHost* new_host) { |
| 5031 NotifyViewSwapped(old_host, new_host); | 5041 NotifyViewSwapped(old_host, new_host); |
| 5032 } | 5042 } |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5519 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5529 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5520 if (!render_view_host) | 5530 if (!render_view_host) |
| 5521 continue; | 5531 continue; |
| 5522 render_view_host_set.insert(render_view_host); | 5532 render_view_host_set.insert(render_view_host); |
| 5523 } | 5533 } |
| 5524 for (RenderViewHost* render_view_host : render_view_host_set) | 5534 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5525 render_view_host->OnWebkitPreferencesChanged(); | 5535 render_view_host->OnWebkitPreferencesChanged(); |
| 5526 } | 5536 } |
| 5527 | 5537 |
| 5528 } // namespace content | 5538 } // namespace content |
| OLD | NEW |