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