Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin_bindings.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| index afb0556a27f35540af3215421dd71dc304f61857..473e1e80c8d54ff528f85144b0a575ce3a19f887 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| + // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
Charlie Reis
2012/10/15 23:10:09
nit: Remove spaces.
Fady Samuel
2012/10/16 19:17:08
Done.
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -41,6 +41,7 @@ const char kAddEventListener[] = "addEventListener"; |
| const char kBackMethod[] = "back"; |
| const char kCanGoBack[] = "canGoBack"; |
| const char kCanGoForward[] = "canGoForward"; |
| +const char kContentWindow[] = "contentWindow"; |
| const char kForwardMethod[] = "forward"; |
| const char kGetProcessId[] = "getProcessId"; |
| const char kGoMethod[] = "go"; |
| @@ -60,6 +61,10 @@ bool IdentifierIsAddEventListener(NPIdentifier identifier) { |
| return WebBindings::getStringIdentifier(kAddEventListener) == identifier; |
| } |
| +bool IdentifierIsContentWindow(NPIdentifier identifier) { |
| + return WebBindings::getStringIdentifier(kContentWindow) == identifier; |
| +} |
| + |
| bool IdentifierIsBackMethod(NPIdentifier identifier) { |
| return WebBindings::getStringIdentifier(kBackMethod) == identifier; |
| } |
| @@ -297,6 +302,7 @@ bool BrowserPluginBindingsInvokeDefault(NPObject* np_obj, |
| bool BrowserPluginBindingsHasProperty(NPObject* np_obj, NPIdentifier name) { |
| return IdentifierIsSrcAttribute(name) || |
| + IdentifierIsContentWindow(name) || |
| IdentifierIsPartitionAttribute(name); |
| } |
| @@ -319,6 +325,15 @@ bool BrowserPluginBindingsGetProperty(NPObject* np_obj, NPIdentifier name, |
| return StringToNPVariant(src, result); |
| } |
| + if (IdentifierIsContentWindow(name)) { |
| + NPObject* obj = bindings->instance()->GetContentWindow(); |
| + if (obj) { |
| + result->type = NPVariantType_Object; |
| + result->value.objectValue = WebBindings::retainObject(obj); |
| + } |
| + return true; |
| + } |
| + |
| if (IdentifierIsPartitionAttribute(name)) { |
| std::string partition_id = bindings->instance()->GetPartitionAttribute(); |
| return StringToNPVariant(partition_id, result); |