| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 FilterURL(policy, renderer_id, &validated_params.referrer); | 968 FilterURL(policy, renderer_id, &validated_params.referrer); |
| 969 for (std::vector<GURL>::iterator it(validated_params.redirects.begin()); | 969 for (std::vector<GURL>::iterator it(validated_params.redirects.begin()); |
| 970 it != validated_params.redirects.end(); ++it) { | 970 it != validated_params.redirects.end(); ++it) { |
| 971 FilterURL(policy, renderer_id, &(*it)); | 971 FilterURL(policy, renderer_id, &(*it)); |
| 972 } | 972 } |
| 973 FilterURL(policy, renderer_id, &validated_params.searchable_form_url); | 973 FilterURL(policy, renderer_id, &validated_params.searchable_form_url); |
| 974 FilterURL(policy, renderer_id, &validated_params.password_form.origin); | 974 FilterURL(policy, renderer_id, &validated_params.password_form.origin); |
| 975 FilterURL(policy, renderer_id, &validated_params.password_form.action); | 975 FilterURL(policy, renderer_id, &validated_params.password_form.action); |
| 976 | 976 |
| 977 delegate_->DidNavigate(this, validated_params); | 977 delegate_->DidNavigate(this, validated_params); |
| 978 | |
| 979 UpdateBackForwardListCount(); | |
| 980 } | 978 } |
| 981 | 979 |
| 982 void RenderViewHost::OnMsgUpdateState(int32 page_id, | 980 void RenderViewHost::OnMsgUpdateState(int32 page_id, |
| 983 const std::string& state) { | 981 const std::string& state) { |
| 984 delegate_->UpdateState(this, page_id, state); | 982 delegate_->UpdateState(this, page_id, state); |
| 985 } | 983 } |
| 986 | 984 |
| 987 void RenderViewHost::OnMsgUpdateTitle(int32 page_id, | 985 void RenderViewHost::OnMsgUpdateTitle(int32 page_id, |
| 988 const std::wstring& title) { | 986 const std::wstring& title) { |
| 989 if (title.length() > chrome::kMaxTitleChars) { | 987 if (title.length() > chrome::kMaxTitleChars) { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 integration_delegate->OnMissingPluginStatus(status); | 1497 integration_delegate->OnMissingPluginStatus(status); |
| 1500 } | 1498 } |
| 1501 | 1499 |
| 1502 void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) { | 1500 void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) { |
| 1503 RenderViewHostDelegate::BrowserIntegration* integration_delegate = | 1501 RenderViewHostDelegate::BrowserIntegration* integration_delegate = |
| 1504 delegate_->GetBrowserIntegrationDelegate(); | 1502 delegate_->GetBrowserIntegrationDelegate(); |
| 1505 if (integration_delegate) | 1503 if (integration_delegate) |
| 1506 integration_delegate->OnCrashedPlugin(plugin_path); | 1504 integration_delegate->OnCrashedPlugin(plugin_path); |
| 1507 } | 1505 } |
| 1508 | 1506 |
| 1509 void RenderViewHost::UpdateBackForwardListCount() { | |
| 1510 int back_list_count = 0, forward_list_count = 0; | |
| 1511 RenderViewHostDelegate::BrowserIntegration* integration_delegate = | |
| 1512 delegate_->GetBrowserIntegrationDelegate(); | |
| 1513 if (integration_delegate) { | |
| 1514 integration_delegate->GetHistoryListCount(&back_list_count, | |
| 1515 &forward_list_count); | |
| 1516 Send(new ViewMsg_UpdateBackForwardListCount( | |
| 1517 routing_id(), back_list_count, forward_list_count)); | |
| 1518 } | |
| 1519 } | |
| 1520 | |
| 1521 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( | 1507 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( |
| 1522 const GURL& page_url) { | 1508 const GURL& page_url) { |
| 1523 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), | 1509 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), |
| 1524 page_url)); | 1510 page_url)); |
| 1525 } | 1511 } |
| 1526 | 1512 |
| 1527 void RenderViewHost::OnReceivedSavableResourceLinksForCurrentPage( | 1513 void RenderViewHost::OnReceivedSavableResourceLinksForCurrentPage( |
| 1528 const std::vector<GURL>& resources_list, | 1514 const std::vector<GURL>& resources_list, |
| 1529 const std::vector<GURL>& referrers_list, | 1515 const std::vector<GURL>& referrers_list, |
| 1530 const std::vector<GURL>& frames_list) { | 1516 const std::vector<GURL>& frames_list) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 integration_delegate->OnPageTranslated(page_id, | 1857 integration_delegate->OnPageTranslated(page_id, |
| 1872 original_lang, translated_lang); | 1858 original_lang, translated_lang); |
| 1873 } | 1859 } |
| 1874 | 1860 |
| 1875 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { | 1861 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { |
| 1876 RenderViewHostDelegate::Resource* resource_delegate = | 1862 RenderViewHostDelegate::Resource* resource_delegate = |
| 1877 delegate_->GetResourceDelegate(); | 1863 delegate_->GetResourceDelegate(); |
| 1878 if (resource_delegate) | 1864 if (resource_delegate) |
| 1879 resource_delegate->OnContentBlocked(type); | 1865 resource_delegate->OnContentBlocked(type); |
| 1880 } | 1866 } |
| OLD | NEW |