| 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 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 3014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3025 | 3025 |
| 3026 WebElement RenderFrameImpl::GetFocusedElement() { | 3026 WebElement RenderFrameImpl::GetFocusedElement() { |
| 3027 WebDocument doc = frame_->document(); | 3027 WebDocument doc = frame_->document(); |
| 3028 if (!doc.isNull()) | 3028 if (!doc.isNull()) |
| 3029 return doc.focusedElement(); | 3029 return doc.focusedElement(); |
| 3030 | 3030 |
| 3031 return WebElement(); | 3031 return WebElement(); |
| 3032 } | 3032 } |
| 3033 | 3033 |
| 3034 void RenderFrameImpl::didStartLoading(bool to_different_document) { | 3034 void RenderFrameImpl::didStartLoading(bool to_different_document) { |
| 3035 bool view_was_loading = render_view_->is_loading(); | |
| 3036 render_view_->FrameDidStartLoading(frame_); | 3035 render_view_->FrameDidStartLoading(frame_); |
| 3037 if (!view_was_loading) | 3036 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); |
| 3038 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); | |
| 3039 } | 3037 } |
| 3040 | 3038 |
| 3041 void RenderFrameImpl::didStopLoading() { | 3039 void RenderFrameImpl::didStopLoading() { |
| 3042 if (!render_view_->is_loading()) | |
| 3043 return; | |
| 3044 render_view_->FrameDidStopLoading(frame_); | 3040 render_view_->FrameDidStopLoading(frame_); |
| 3045 | 3041 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
| 3046 // NOTE: For now we're doing the safest thing, and sending out notification | |
| 3047 // when done loading. This currently isn't an issue as the favicon is only | |
| 3048 // displayed when done loading. Ideally we would send notification when | |
| 3049 // finished parsing the head, but webkit doesn't support that yet. | |
| 3050 // The feed discovery code would also benefit from access to the head. | |
| 3051 if (!render_view_->is_loading()) | |
| 3052 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | |
| 3053 } | 3042 } |
| 3054 | 3043 |
| 3055 void RenderFrameImpl::didChangeLoadProgress(double load_progress) { | 3044 void RenderFrameImpl::didChangeLoadProgress(double load_progress) { |
| 3056 render_view_->FrameDidChangeLoadProgress(frame_, load_progress); | 3045 Send(new FrameHostMsg_DidChangeLoadProgress(routing_id_, load_progress)); |
| 3057 } | 3046 } |
| 3058 | 3047 |
| 3059 WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( | 3048 WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( |
| 3060 RenderFrame* render_frame, | 3049 RenderFrame* render_frame, |
| 3061 WebFrame* frame, | 3050 WebFrame* frame, |
| 3062 WebDataSource::ExtraData* extraData, | 3051 WebDataSource::ExtraData* extraData, |
| 3063 const WebURLRequest& request, | 3052 const WebURLRequest& request, |
| 3064 WebNavigationType type, | 3053 WebNavigationType type, |
| 3065 WebNavigationPolicy default_policy, | 3054 WebNavigationPolicy default_policy, |
| 3066 bool is_redirect) { | 3055 bool is_redirect) { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 weak_factory_.GetWeakPtr(), | 3459 weak_factory_.GetWeakPtr(), |
| 3471 render_view_->media_player_manager_, | 3460 render_view_->media_player_manager_, |
| 3472 stream_texture_factory, | 3461 stream_texture_factory, |
| 3473 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 3462 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 3474 new RenderMediaLog()); | 3463 new RenderMediaLog()); |
| 3475 } | 3464 } |
| 3476 | 3465 |
| 3477 #endif | 3466 #endif |
| 3478 | 3467 |
| 3479 } // namespace content | 3468 } // namespace content |
| OLD | NEW |