OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/plugin_content_origin_whitelist.h" | 5 #include "content/browser/plugin_content_origin_whitelist.h" |
6 | 6 |
7 #include "content/common/frame_messages.h" | 7 #include "content/common/frame_messages.h" |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 IPC_MESSAGE_UNHANDLED(handled = false) | 37 IPC_MESSAGE_UNHANDLED(handled = false) |
38 IPC_END_MESSAGE_MAP() | 38 IPC_END_MESSAGE_MAP() |
39 | 39 |
40 return handled; | 40 return handled; |
41 } | 41 } |
42 | 42 |
43 void PluginContentOriginWhitelist::DidFinishNavigation( | 43 void PluginContentOriginWhitelist::DidFinishNavigation( |
44 NavigationHandle* navigation_handle) { | 44 NavigationHandle* navigation_handle) { |
45 if (!navigation_handle->IsInMainFrame() || | 45 if (!navigation_handle->IsInMainFrame() || |
46 !navigation_handle->HasCommitted() || | 46 !navigation_handle->HasCommitted() || |
47 navigation_handle->IsSamePage()) { | 47 navigation_handle->IsSameDocument()) { |
48 return; | 48 return; |
49 } | 49 } |
50 | 50 |
51 // We expect RenderFrames to clear their replicated whitelist independently. | 51 // We expect RenderFrames to clear their replicated whitelist independently. |
52 whitelist_.clear(); | 52 whitelist_.clear(); |
53 } | 53 } |
54 | 54 |
55 void PluginContentOriginWhitelist::OnPluginContentOriginAllowed( | 55 void PluginContentOriginWhitelist::OnPluginContentOriginAllowed( |
56 const url::Origin& content_origin) { | 56 const url::Origin& content_origin) { |
57 whitelist_.insert(content_origin); | 57 whitelist_.insert(content_origin); |
58 | 58 |
59 web_contents()->SendToAllFrames( | 59 web_contents()->SendToAllFrames( |
60 new FrameMsg_UpdatePluginContentOriginWhitelist( | 60 new FrameMsg_UpdatePluginContentOriginWhitelist( |
61 MSG_ROUTING_NONE, whitelist_)); | 61 MSG_ROUTING_NONE, whitelist_)); |
62 } | 62 } |
63 | 63 |
64 } // namespace content | 64 } // namespace content |
OLD | NEW |