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/child/npapi/plugin_instance.h" | 5 #include "content/child/npapi/plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 668 } |
669 } | 669 } |
670 | 670 |
671 void PluginInstance::URLRedirectResponse(bool allow, void* notify_data) { | 671 void PluginInstance::URLRedirectResponse(bool allow, void* notify_data) { |
672 // The notify_data passed in allows us to identify the matching stream. | 672 // The notify_data passed in allows us to identify the matching stream. |
673 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; | 673 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; |
674 for (stream_index = open_streams_.begin(); | 674 for (stream_index = open_streams_.begin(); |
675 stream_index != open_streams_.end(); ++stream_index) { | 675 stream_index != open_streams_.end(); ++stream_index) { |
676 PluginStream* plugin_stream = stream_index->get(); | 676 PluginStream* plugin_stream = stream_index->get(); |
677 if (plugin_stream->notify_data() == notify_data) { | 677 if (plugin_stream->notify_data() == notify_data) { |
678 WebPluginResourceClient* resource_client = | 678 PluginStreamUrl* plugin_stream_url = |
679 plugin_stream->AsResourceClient(); | 679 static_cast<PluginStreamUrl*>(plugin_stream); |
680 webplugin_->URLRedirectResponse(allow, resource_client->ResourceId()); | 680 plugin_stream_url->URLRedirectResponse(allow); |
681 if (allow) { | |
682 plugin_stream->UpdateUrl( | |
683 plugin_stream->pending_redirect_url().c_str()); | |
684 } | |
685 break; | 681 break; |
686 } | 682 } |
687 } | 683 } |
688 } | 684 } |
689 | 685 |
690 } // namespace content | 686 } // namespace content |
OLD | NEW |