OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 } | 883 } |
884 FilterURL(policy, renderer_id, &validated_params.searchable_form_url); | 884 FilterURL(policy, renderer_id, &validated_params.searchable_form_url); |
885 FilterURL(policy, renderer_id, &validated_params.password_form.origin); | 885 FilterURL(policy, renderer_id, &validated_params.password_form.origin); |
886 FilterURL(policy, renderer_id, &validated_params.password_form.action); | 886 FilterURL(policy, renderer_id, &validated_params.password_form.action); |
887 | 887 |
888 delegate_->DidNavigate(this, validated_params); | 888 delegate_->DidNavigate(this, validated_params); |
889 | 889 |
890 if (PageTransition::IsMainFrame(validated_params.transition)) { | 890 if (PageTransition::IsMainFrame(validated_params.transition)) { |
891 ExtensionFunctionDispatcher* new_efd = NULL; | 891 ExtensionFunctionDispatcher* new_efd = NULL; |
892 if (validated_params.url.SchemeIs(chrome::kExtensionScheme)) { | 892 if (validated_params.url.SchemeIs(chrome::kExtensionScheme)) { |
893 new_efd = new ExtensionFunctionDispatcher(this, | 893 new_efd = delegate()->CreateExtensionFunctionDispatcher(this, |
894 validated_params.url.host()); | 894 validated_params.url.host()); |
895 } | 895 } |
896 extension_function_dispatcher_.reset(new_efd); | 896 extension_function_dispatcher_.reset(new_efd); |
897 } | 897 } |
898 | 898 |
899 UpdateBackForwardListCount(); | 899 UpdateBackForwardListCount(); |
900 } | 900 } |
901 | 901 |
902 void RenderViewHost::OnMsgUpdateState(int32 page_id, | 902 void RenderViewHost::OnMsgUpdateState(int32 page_id, |
903 const std::string& state) { | 903 const std::string& state) { |
904 delegate_->UpdateState(this, page_id, state); | 904 delegate_->UpdateState(this, page_id, state); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 const std::string& target) { | 1345 const std::string& target) { |
1346 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), message, origin, | 1346 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), message, origin, |
1347 target)); | 1347 target)); |
1348 } | 1348 } |
1349 | 1349 |
1350 void RenderViewHost::OnExtensionRequest(const std::string& name, | 1350 void RenderViewHost::OnExtensionRequest(const std::string& name, |
1351 const std::string& args, | 1351 const std::string& args, |
1352 int callback_id) { | 1352 int callback_id) { |
1353 // TODO(aa): Here is where we can check that this renderer was supposed to be | 1353 // TODO(aa): Here is where we can check that this renderer was supposed to be |
1354 // able to call extension APIs. | 1354 // able to call extension APIs. |
| 1355 DCHECK(extension_function_dispatcher_.get()); |
1355 extension_function_dispatcher_->HandleRequest(name, args, callback_id); | 1356 extension_function_dispatcher_->HandleRequest(name, args, callback_id); |
1356 } | 1357 } |
1357 | 1358 |
1358 void RenderViewHost::SendExtensionResponse(int callback_id, | 1359 void RenderViewHost::SendExtensionResponse(int callback_id, |
1359 const std::string& response) { | 1360 const std::string& response) { |
1360 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1361 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
1361 } | 1362 } |
OLD | NEW |