| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/external_host_bindings.h" | 5 #include "chrome/renderer/external_host_bindings.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 target = resolved.spec(); | 45 target = resolved.spec(); |
| 46 } | 46 } |
| 47 } else { | 47 } else { |
| 48 target = "*"; | 48 target = "*"; |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::string origin = frame_->document().securityOrigin().toString().utf8(); | 51 std::string origin = frame_->document().securityOrigin().toString().utf8(); |
| 52 | 52 |
| 53 result->Set(sender()->Send(new ViewHostMsg_ForwardMessageToExternalHost( | 53 result->Set(sender()->Send( |
| 54 routing_id(), message, origin, target))); | 54 new ChromeViewHostMsg_ForwardMessageToExternalHost( |
| 55 routing_id(), message, origin, target))); |
| 55 } | 56 } |
| 56 | 57 |
| 57 bool ExternalHostBindings::ForwardMessageFromExternalHost( | 58 bool ExternalHostBindings::ForwardMessageFromExternalHost( |
| 58 const std::string& message, const std::string& origin, | 59 const std::string& message, const std::string& origin, |
| 59 const std::string& target) { | 60 const std::string& target) { |
| 60 if (!on_message_handler_.isObject()) | 61 if (!on_message_handler_.isObject()) |
| 61 return false; | 62 return false; |
| 62 | 63 |
| 63 bool status = false; | 64 bool status = false; |
| 64 | 65 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 DCHECK(success == false); | 172 DCHECK(success == false); |
| 172 } else { | 173 } else { |
| 173 DCHECK(success != false); | 174 DCHECK(success != false); |
| 174 // Pass the ownership to the caller (don't call ReleaseVariantValue). | 175 // Pass the ownership to the caller (don't call ReleaseVariantValue). |
| 175 *message_event = result.value.objectValue; | 176 *message_event = result.value.objectValue; |
| 176 } | 177 } |
| 177 } | 178 } |
| 178 | 179 |
| 179 return success; | 180 return success; |
| 180 } | 181 } |
| OLD | NEW |