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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 WebMediaPlayerParams params( | 2058 WebMediaPlayerParams params( |
2059 base::Bind(&ContentRendererClient::DeferMediaLoad, | 2059 base::Bind(&ContentRendererClient::DeferMediaLoad, |
2060 base::Unretained(GetContentClient()->renderer()), | 2060 base::Unretained(GetContentClient()->renderer()), |
2061 static_cast<RenderFrame*>(render_frame)), | 2061 static_cast<RenderFrame*>(render_frame)), |
2062 RenderThreadImpl::current()->GetAudioRendererMixerManager()->CreateInput( | 2062 RenderThreadImpl::current()->GetAudioRendererMixerManager()->CreateInput( |
2063 routing_id_, render_frame->GetRoutingID())); | 2063 routing_id_, render_frame->GetRoutingID())); |
2064 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); | 2064 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); |
2065 #endif // defined(OS_ANDROID) | 2065 #endif // defined(OS_ANDROID) |
2066 } | 2066 } |
2067 | 2067 |
2068 void RenderViewImpl::didAccessInitialDocument(WebLocalFrame* frame) { | |
2069 // Notify the browser process that it is no longer safe to show the pending | |
2070 // URL of the main frame, since a URL spoof is now possible. | |
2071 if (!frame->parent() && page_id_ == -1) | |
2072 Send(new ViewHostMsg_DidAccessInitialDocument(routing_id_)); | |
2073 } | |
2074 | |
2075 void RenderViewImpl::didDisownOpener(blink::WebLocalFrame* frame) { | 2068 void RenderViewImpl::didDisownOpener(blink::WebLocalFrame* frame) { |
2076 // We only need to notify the browser if the active, top-level frame clears | 2069 // We only need to notify the browser if the active, top-level frame clears |
2077 // its opener. We can ignore cases where a swapped out frame clears its | 2070 // its opener. We can ignore cases where a swapped out frame clears its |
2078 // opener after hearing about it from the browser, and the browser does not | 2071 // opener after hearing about it from the browser, and the browser does not |
2079 // (yet) care about subframe openers. | 2072 // (yet) care about subframe openers. |
2080 if (is_swapped_out_ || frame->parent()) | 2073 if (is_swapped_out_ || frame->parent()) |
2081 return; | 2074 return; |
2082 | 2075 |
2083 // Notify WebContents and all its swapped out RenderViews. | 2076 // Notify WebContents and all its swapped out RenderViews. |
2084 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); | 2077 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); |
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4439 std::vector<gfx::Size> sizes; | 4432 std::vector<gfx::Size> sizes; |
4440 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4433 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4441 if (!url.isEmpty()) | 4434 if (!url.isEmpty()) |
4442 urls.push_back( | 4435 urls.push_back( |
4443 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4436 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4444 } | 4437 } |
4445 SendUpdateFaviconURL(urls); | 4438 SendUpdateFaviconURL(urls); |
4446 } | 4439 } |
4447 | 4440 |
4448 } // namespace content | 4441 } // namespace content |
OLD | NEW |