OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/renderer/extension_frame_helper.h" | 5 #include "extensions/renderer/extension_frame_helper.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "content/public/renderer/render_frame.h" | 8 #include "content/public/renderer/render_frame.h" |
9 #include "extensions/common/api/messaging/message.h" | 9 #include "extensions/common/api/messaging/message.h" |
10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 frame_helper->view_type() != match_view_type) | 37 frame_helper->view_type() != match_view_type) |
38 return false; | 38 return false; |
39 | 39 |
40 // Not all frames have a valid ViewType, e.g. devtools, most GuestViews, and | 40 // Not all frames have a valid ViewType, e.g. devtools, most GuestViews, and |
41 // unclassified detached WebContents. | 41 // unclassified detached WebContents. |
42 if (frame_helper->view_type() == VIEW_TYPE_INVALID) | 42 if (frame_helper->view_type() == VIEW_TYPE_INVALID) |
43 return false; | 43 return false; |
44 | 44 |
45 // This logic matches ExtensionWebContentsObserver::GetExtensionFromFrame. | 45 // This logic matches ExtensionWebContentsObserver::GetExtensionFromFrame. |
46 blink::WebSecurityOrigin origin = | 46 blink::WebSecurityOrigin origin = |
47 frame_helper->render_frame()->GetWebFrame()->securityOrigin(); | 47 frame_helper->render_frame()->GetWebFrame()->getSecurityOrigin(); |
48 if (origin.isUnique() || | 48 if (origin.isUnique() || |
49 !base::EqualsASCII(base::StringPiece16(origin.protocol()), | 49 !base::EqualsASCII(base::StringPiece16(origin.protocol()), |
50 kExtensionScheme) || | 50 kExtensionScheme) || |
51 !base::EqualsASCII(base::StringPiece16(origin.host()), | 51 !base::EqualsASCII(base::StringPiece16(origin.host()), |
52 match_extension_id.c_str())) | 52 match_extension_id.c_str())) |
53 return false; | 53 return false; |
54 | 54 |
55 if (match_window_id != extension_misc::kUnknownWindowId && | 55 if (match_window_id != extension_misc::kUnknownWindowId && |
56 frame_helper->browser_window_id() != match_window_id) | 56 frame_helper->browser_window_id() != match_window_id) |
57 return false; | 57 return false; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 const std::string& module_name, | 228 const std::string& module_name, |
229 const std::string& function_name, | 229 const std::string& function_name, |
230 const base::ListValue& args, | 230 const base::ListValue& args, |
231 bool user_gesture) { | 231 bool user_gesture) { |
232 extension_dispatcher_->InvokeModuleSystemMethod(render_frame(), extension_id, | 232 extension_dispatcher_->InvokeModuleSystemMethod(render_frame(), extension_id, |
233 module_name, function_name, | 233 module_name, function_name, |
234 args, user_gesture); | 234 args, user_gesture); |
235 } | 235 } |
236 | 236 |
237 } // namespace extensions | 237 } // namespace extensions |
OLD | NEW |