| 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/renderer/browser_plugin/browser_plugin_bindings.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 private: | 310 private: |
| 311 DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingTrackObjectLifetime); | 311 DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingTrackObjectLifetime); |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 // Note: This is a method that is used internally by the <webview> shim only. | 314 // Note: This is a method that is used internally by the <webview> shim only. |
| 315 // This should not be exposed to developers. | 315 // This should not be exposed to developers. |
| 316 class BrowserPluginBindingSetPermission : public BrowserPluginMethodBinding { | 316 class BrowserPluginBindingSetPermission : public BrowserPluginMethodBinding { |
| 317 public: | 317 public: |
| 318 BrowserPluginBindingSetPermission() | 318 BrowserPluginBindingSetPermission() |
| 319 : BrowserPluginMethodBinding( | 319 : BrowserPluginMethodBinding( |
| 320 browser_plugin::kMethodInternalSetPermission, 2) { | 320 browser_plugin::kMethodInternalSetPermission, 3) { |
| 321 } | 321 } |
| 322 | 322 |
| 323 virtual bool Invoke(BrowserPluginBindings* bindings, | 323 virtual bool Invoke(BrowserPluginBindings* bindings, |
| 324 const NPVariant* args, | 324 const NPVariant* args, |
| 325 NPVariant* result) OVERRIDE { | 325 NPVariant* result) OVERRIDE { |
| 326 int request_id = IntFromNPVariant(args[0]); | 326 int request_id = IntFromNPVariant(args[0]); |
| 327 bool allow = NPVARIANT_TO_BOOLEAN(args[1]); | 327 bool allow = NPVARIANT_TO_BOOLEAN(args[1]); |
| 328 bindings->instance()->OnEmbedderDecidedPermission(request_id, allow); | 328 std::string user_input = StringFromNPVariant(args[2]); |
| 329 bindings->instance()->OnEmbedderDecidedPermission( |
| 330 request_id, allow, user_input); |
| 329 return true; | 331 return true; |
| 330 } | 332 } |
| 331 | 333 |
| 332 private: | 334 private: |
| 333 DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingSetPermission); | 335 DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingSetPermission); |
| 334 }; | 336 }; |
| 335 | 337 |
| 336 // BrowserPluginPropertyBinding ------------------------------------------------ | 338 // BrowserPluginPropertyBinding ------------------------------------------------ |
| 337 | 339 |
| 338 class BrowserPluginPropertyBinding { | 340 class BrowserPluginPropertyBinding { |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 for (PropertyBindingList::iterator iter = property_bindings_.begin(); | 778 for (PropertyBindingList::iterator iter = property_bindings_.begin(); |
| 777 iter != property_bindings_.end(); | 779 iter != property_bindings_.end(); |
| 778 ++iter) { | 780 ++iter) { |
| 779 if ((*iter)->MatchesName(name)) | 781 if ((*iter)->MatchesName(name)) |
| 780 return (*iter)->GetProperty(this, result); | 782 return (*iter)->GetProperty(this, result); |
| 781 } | 783 } |
| 782 return false; | 784 return false; |
| 783 } | 785 } |
| 784 | 786 |
| 785 } // namespace content | 787 } // namespace content |
| OLD | NEW |