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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 FilterURL(policy, process, true, &validated_params.src_url); | 1354 FilterURL(policy, process, true, &validated_params.src_url); |
1355 FilterURL(policy, process, false, &validated_params.page_url); | 1355 FilterURL(policy, process, false, &validated_params.page_url); |
1356 FilterURL(policy, process, true, &validated_params.frame_url); | 1356 FilterURL(policy, process, true, &validated_params.frame_url); |
1357 | 1357 |
1358 delegate_->ShowContextMenu(validated_params); | 1358 delegate_->ShowContextMenu(validated_params); |
1359 } | 1359 } |
1360 | 1360 |
1361 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { | 1361 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { |
1362 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1362 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1363 delegate_->ToggleFullscreenMode(enter_fullscreen); | 1363 delegate_->ToggleFullscreenMode(enter_fullscreen); |
| 1364 // We need to notify the contents that its fullscreen state has changed. This |
| 1365 // is done as part of the resize message. |
1364 WasResized(); | 1366 WasResized(); |
1365 } | 1367 } |
1366 | 1368 |
1367 void RenderViewHostImpl::OnOpenURL( | 1369 void RenderViewHostImpl::OnOpenURL( |
1368 const ViewHostMsg_OpenURL_Params& params) { | 1370 const ViewHostMsg_OpenURL_Params& params) { |
1369 GURL validated_url(params.url); | 1371 GURL validated_url(params.url); |
1370 FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(), | 1372 FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(), |
1371 GetProcess(), false, &validated_url); | 1373 GetProcess(), false, &validated_url); |
1372 | 1374 |
1373 delegate_->RequestOpenURL( | 1375 delegate_->RequestOpenURL( |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 } | 1776 } |
1775 } | 1777 } |
1776 } | 1778 } |
1777 | 1779 |
1778 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { | 1780 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { |
1779 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); | 1781 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); |
1780 } | 1782 } |
1781 | 1783 |
1782 void RenderViewHostImpl::ExitFullscreen() { | 1784 void RenderViewHostImpl::ExitFullscreen() { |
1783 RejectMouseLockOrUnlockIfNecessary(); | 1785 RejectMouseLockOrUnlockIfNecessary(); |
1784 // We need to notify the contents that its fullscreen state has changed. This | 1786 // Notify delegate_ and renderer of fullscreen state change. |
1785 // is done as part of the resize message. | 1787 OnToggleFullscreen(false); |
1786 WasResized(); | |
1787 } | 1788 } |
1788 | 1789 |
1789 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { | 1790 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { |
1790 return delegate_->GetWebkitPrefs(); | 1791 return delegate_->GetWebkitPrefs(); |
1791 } | 1792 } |
1792 | 1793 |
1793 void RenderViewHostImpl::DisownOpener() { | 1794 void RenderViewHostImpl::DisownOpener() { |
1794 // This should only be called when swapped out. | 1795 // This should only be called when swapped out. |
1795 DCHECK(is_swapped_out_); | 1796 DCHECK(is_swapped_out_); |
1796 | 1797 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 2065 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
2065 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2066 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
2066 file != file_paths.end(); ++file) { | 2067 file != file_paths.end(); ++file) { |
2067 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2068 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
2068 return false; | 2069 return false; |
2069 } | 2070 } |
2070 return true; | 2071 return true; |
2071 } | 2072 } |
2072 | 2073 |
2073 } // namespace content | 2074 } // namespace content |
OLD | NEW |