OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 3360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( | 3371 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
3372 render_view_->GetRoutingID(), | 3372 render_view_->GetRoutingID(), |
3373 main_frame->document().isPluginDocument())); | 3373 main_frame->document().isPluginDocument())); |
3374 } | 3374 } |
3375 } | 3375 } |
3376 | 3376 |
3377 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, | 3377 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
3378 DidCreateDocumentElement()); | 3378 DidCreateDocumentElement()); |
3379 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), | 3379 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), |
3380 DidCreateDocumentElement(frame)); | 3380 DidCreateDocumentElement(frame)); |
| 3381 |
| 3382 GetContentClient()->renderer()->AfterDidCreateDocumentElement(this); |
| 3383 // Do not use |this| or |frame|! ContentClient might have deleted them by now! |
3381 } | 3384 } |
3382 | 3385 |
3383 void RenderFrameImpl::didReceiveTitle(blink::WebLocalFrame* frame, | 3386 void RenderFrameImpl::didReceiveTitle(blink::WebLocalFrame* frame, |
3384 const blink::WebString& title, | 3387 const blink::WebString& title, |
3385 blink::WebTextDirection direction) { | 3388 blink::WebTextDirection direction) { |
3386 DCHECK(!frame_ || frame_ == frame); | 3389 DCHECK(!frame_ || frame_ == frame); |
3387 // Ignore all but top level navigations. | 3390 // Ignore all but top level navigations. |
3388 if (!frame->parent()) { | 3391 if (!frame->parent()) { |
3389 base::string16 title16 = title; | 3392 base::string16 title16 = title; |
3390 base::trace_event::TraceLog::GetInstance()->UpdateProcessLabel( | 3393 base::trace_event::TraceLog::GetInstance()->UpdateProcessLabel( |
(...skipping 23 matching lines...) Expand all Loading... |
3414 WebDataSource* ds = frame->dataSource(); | 3417 WebDataSource* ds = frame->dataSource(); |
3415 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3418 DocumentState* document_state = DocumentState::FromDataSource(ds); |
3416 document_state->set_finish_document_load_time(Time::Now()); | 3419 document_state->set_finish_document_load_time(Time::Now()); |
3417 | 3420 |
3418 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_)); | 3421 Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_)); |
3419 | 3422 |
3420 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), | 3423 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), |
3421 DidFinishDocumentLoad(frame)); | 3424 DidFinishDocumentLoad(frame)); |
3422 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad()); | 3425 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishDocumentLoad()); |
3423 | 3426 |
| 3427 base::WeakPtr<RenderFrame> weak_self = weak_factory_.GetWeakPtr(); |
| 3428 GetContentClient()->renderer()->AfterDidFinishDocumentLoad(this); |
| 3429 if (!weak_self.get()) |
| 3430 return; |
| 3431 |
3424 // Check whether we have new encoding name. | 3432 // Check whether we have new encoding name. |
3425 UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); | 3433 UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); |
3426 | 3434 |
3427 // If this is an empty document with an http status code indicating an error, | 3435 // If this is an empty document with an http status code indicating an error, |
3428 // we may want to display our own error page, so the user doesn't end up | 3436 // we may want to display our own error page, so the user doesn't end up |
3429 // with an unexplained blank page. | 3437 // with an unexplained blank page. |
3430 if (!document_is_empty) | 3438 if (!document_is_empty) |
3431 return; | 3439 return; |
3432 | 3440 |
3433 // Do not show error page when DevTools is attached. | 3441 // Do not show error page when DevTools is attached. |
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6131 int match_count, | 6139 int match_count, |
6132 int ordinal, | 6140 int ordinal, |
6133 const WebRect& selection_rect, | 6141 const WebRect& selection_rect, |
6134 bool final_status_update) { | 6142 bool final_status_update) { |
6135 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6143 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6136 selection_rect, ordinal, | 6144 selection_rect, ordinal, |
6137 final_status_update)); | 6145 final_status_update)); |
6138 } | 6146 } |
6139 | 6147 |
6140 } // namespace content | 6148 } // namespace content |
OLD | NEW |