diff options
-rw-r--r-- | chrome/renderer/automation/dom_automation_controller.cc | 12 | ||||
-rw-r--r-- | chrome/renderer/external_host_bindings.cc | 5 | ||||
-rw-r--r-- | chrome/renderer/plugins/blocked_plugin.cc | 11 | ||||
-rw-r--r-- | chrome/renderer/plugins/missing_plugin.cc | 4 | ||||
-rw-r--r-- | content/renderer/intents_dispatcher.cc | 17 | ||||
-rw-r--r-- | content/renderer/web_ui_bindings.cc | 5 | ||||
-rw-r--r-- | webkit/glue/cpp_binding_example.cc | 20 | ||||
-rw-r--r-- | webkit/glue/cpp_bound_class.h | 39 | ||||
-rw-r--r-- | webkit/glue/cpp_bound_class_unittest.cc | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/accessibility_ui_element.cc | 171 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 14 |
11 files changed, 191 insertions, 118 deletions
diff --git a/chrome/renderer/automation/dom_automation_controller.cc b/chrome/renderer/automation/dom_automation_controller.cc index 0416103..81b2be6 100644 --- a/chrome/renderer/automation/dom_automation_controller.cc +++ b/chrome/renderer/automation/dom_automation_controller.cc @@ -4,6 +4,8 @@ #include "chrome/renderer/automation/dom_automation_controller.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/json/json_value_serializer.h" #include "base/string_util.h" #include "chrome/common/render_messages.h" @@ -12,9 +14,13 @@ DomAutomationController::DomAutomationController() : sender_(NULL), routing_id_(MSG_ROUTING_NONE), automation_id_(MSG_ROUTING_NONE) { - BindMethod("send", &DomAutomationController::Send); - BindMethod("setAutomationId", &DomAutomationController::SetAutomationId); - BindMethod("sendJSON", &DomAutomationController::SendJSON); + BindCallback("send", base::Bind(&DomAutomationController::Send, + base::Unretained(this))); + BindCallback("setAutomationId", + base::Bind(&DomAutomationController::SetAutomationId, + base::Unretained(this))); + BindCallback("sendJSON", base::Bind(&DomAutomationController::SendJSON, + base::Unretained(this))); } void DomAutomationController::Send(const CppArgumentList& args, diff --git a/chrome/renderer/external_host_bindings.cc b/chrome/renderer/external_host_bindings.cc index 13585e2..33ac0bb 100644 --- a/chrome/renderer/external_host_bindings.cc +++ b/chrome/renderer/external_host_bindings.cc @@ -4,6 +4,8 @@ #include "chrome/renderer/external_host_bindings.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/values.h" #include "chrome/common/render_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" @@ -15,7 +17,8 @@ using WebKit::WebBindings; ExternalHostBindings::ExternalHostBindings(IPC::Message::Sender* sender, int routing_id) : frame_(NULL), sender_(sender), routing_id_(routing_id) { - BindMethod("postMessage", &ExternalHostBindings::PostMessage); + BindCallback("postMessage", base::Bind(&ExternalHostBindings::PostMessage, + base::Unretained(this))); BindProperty("onmessage", &on_message_handler_); } diff --git a/chrome/renderer/plugins/blocked_plugin.cc b/chrome/renderer/plugins/blocked_plugin.cc index 806e711..4cbeff9 100644 --- a/chrome/renderer/plugins/blocked_plugin.cc +++ b/chrome/renderer/plugins/blocked_plugin.cc @@ -4,6 +4,8 @@ #include "chrome/renderer/plugins/blocked_plugin.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/string_piece.h" #include "base/string_util.h" #include "base/values.h" @@ -96,9 +98,12 @@ BlockedPlugin::~BlockedPlugin() { void BlockedPlugin::BindWebFrame(WebFrame* frame) { PluginPlaceholder::BindWebFrame(frame); - BindMethod("load", &BlockedPlugin::LoadCallback); - BindMethod("hide", &BlockedPlugin::HideCallback); - BindMethod("openURL", &BlockedPlugin::OpenUrlCallback); + BindCallback("load", base::Bind(&BlockedPlugin::LoadCallback, + base::Unretained(this))); + BindCallback("hide", base::Bind(&BlockedPlugin::HideCallback, + base::Unretained(this))); + BindCallback("openURL", base::Bind(&BlockedPlugin::OpenUrlCallback, + base::Unretained(this))); } void BlockedPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) { diff --git a/chrome/renderer/plugins/missing_plugin.cc b/chrome/renderer/plugins/missing_plugin.cc index 6b8acf9..6c13f0b 100644 --- a/chrome/renderer/plugins/missing_plugin.cc +++ b/chrome/renderer/plugins/missing_plugin.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/plugins/missing_plugin.h" +#include "base/bind.h" #include "base/json/string_escape.h" #include "base/string_piece.h" #include "base/string_util.h" @@ -84,7 +85,8 @@ MissingPlugin::~MissingPlugin() { void MissingPlugin::BindWebFrame(WebFrame* frame) { PluginPlaceholder::BindWebFrame(frame); - BindMethod("hide", &MissingPlugin::HideCallback); + BindCallback("hide", base::Bind(&MissingPlugin::HideCallback, + base::Unretained(this))); } void MissingPlugin::HideCallback(const CppArgumentList& args, diff --git a/content/renderer/intents_dispatcher.cc b/content/renderer/intents_dispatcher.cc index adcb2e4b4..e4e6d69 100644 --- a/content/renderer/intents_dispatcher.cc +++ b/content/renderer/intents_dispatcher.cc @@ -4,6 +4,8 @@ #include "content/renderer/intents_dispatcher.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "content/common/intents_messages.h" #include "content/renderer/render_view_impl.h" #include "ipc/ipc_message.h" @@ -50,11 +52,16 @@ class IntentsDispatcher::BoundDeliveredIntent : public CppBoundClass { frame->windowObject(), data_val_.get()); - BindProperty("action", &BoundDeliveredIntent::getAction); - BindProperty("type", &BoundDeliveredIntent::getType); - BindProperty("data", &BoundDeliveredIntent::getData); - BindMethod("postResult", &BoundDeliveredIntent::postResult); - BindMethod("postFailure", &BoundDeliveredIntent::postFailure); + BindGetterCallback("action", base::Bind(&BoundDeliveredIntent::getAction, + base::Unretained(this))); + BindGetterCallback("type", base::Bind(&BoundDeliveredIntent::getType, + base::Unretained(this))); + BindGetterCallback("data", base::Bind(&BoundDeliveredIntent::getData, + base::Unretained(this))); + BindCallback("postResult", base::Bind(&BoundDeliveredIntent::postResult, + base::Unretained(this))); + BindCallback("postFailure", base::Bind(&BoundDeliveredIntent::postFailure, + base::Unretained(this))); } virtual ~BoundDeliveredIntent() { diff --git a/content/renderer/web_ui_bindings.cc b/content/renderer/web_ui_bindings.cc index 579582e..71198e9 100644 --- a/content/renderer/web_ui_bindings.cc +++ b/content/renderer/web_ui_bindings.cc @@ -4,6 +4,8 @@ #include "content/renderer/web_ui_bindings.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/memory/scoped_ptr.h" #include "base/stl_util.h" #include "base/values.h" @@ -52,7 +54,8 @@ DOMBoundBrowserObject::~DOMBoundBrowserObject() { WebUIBindings::WebUIBindings(IPC::Message::Sender* sender, int routing_id) : sender_(sender), routing_id_(routing_id) { - BindMethod("send", &WebUIBindings::Send); + BindCallback("send", base::Bind(&WebUIBindings::Send, + base::Unretained(this))); } WebUIBindings::~WebUIBindings() {} diff --git a/webkit/glue/cpp_binding_example.cc b/webkit/glue/cpp_binding_example.cc index 79e96e4..678151a 100644 --- a/webkit/glue/cpp_binding_example.cc +++ b/webkit/glue/cpp_binding_example.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,9 @@ #include "cpp_binding_example.h" +#include "base/bind.h" +#include "base/bind_helpers.h" + namespace { class PropertyCallbackExample : public CppBoundClass::PropertyCallback { @@ -37,17 +40,22 @@ CppBindingExample::CppBindingExample() { // Bind property with a callback. BindProperty("my_value_with_callback", new PropertyCallbackExample()); // Bind property with a getter callback. - BindProperty("same", &CppBindingExample::same); + BindGetterCallback("same", base::Bind(&CppBindingExample::same, + base::Unretained(this))); // Map methods. See comment above about names. - BindMethod("echoValue", &CppBindingExample::echoValue); - BindMethod("echoType", &CppBindingExample::echoType); - BindMethod("plus", &CppBindingExample::plus); + BindCallback("echoValue", base::Bind(&CppBindingExample::echoValue, + base::Unretained(this))); + BindCallback("echoType", base::Bind(&CppBindingExample::echoType, + base::Unretained(this))); + BindCallback("plus", base::Bind(&CppBindingExample::plus, + base::Unretained(this))); // The fallback method is called when a nonexistent method is called on an // object. If none is specified, calling a nonexistent method causes an // exception to be thrown and the JavaScript execution is stopped. - BindFallbackMethod(&CppBindingExample::fallbackMethod); + BindFallbackCallback(base::Bind(&CppBindingExample::fallbackMethod, + base::Unretained(this))); my_value.Set(10); my_other_value.Set("Reinitialized!"); diff --git a/webkit/glue/cpp_bound_class.h b/webkit/glue/cpp_bound_class.h index 3481258..8bc0dfd 100644 --- a/webkit/glue/cpp_bound_class.h +++ b/webkit/glue/cpp_bound_class.h @@ -23,7 +23,6 @@ #include "webkit/glue/cpp_variant.h" -#include "base/bind.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" @@ -49,8 +48,8 @@ class CppBoundClass { virtual bool SetValue(const CppVariant& value) = 0; }; - // The constructor should call BindMethod, BindProperty, and - // SetFallbackMethod as needed to set up the methods, properties, and + // The constructor should call BindCallback, BindProperty, and + // BindFallbackCallback as needed to set up the methods, properties, and // fallback method. CppBoundClass(); virtual ~CppBoundClass(); @@ -80,30 +79,11 @@ class CppBoundClass { // Bind the Javascript method called |name| to the C++ callback |callback|. void BindCallback(const std::string& name, const Callback& callback); - // A wrapper for BindCallback, to simplify the common case of binding a - // method on the current object. Though not verified here, |method| - // must be a method of this CppBoundClass subclass. - template<typename T> - void BindMethod(const std::string& name, - void (T::*method)(const CppArgumentList&, CppVariant*)) { - BindCallback(name, - base::Bind(method, base::Unretained(static_cast<T*>(this)))); - } - // Bind Javascript property |name| to the C++ getter callback |callback|. // This can be used to create read-only properties. void BindGetterCallback(const std::string& name, const GetterCallback& callback); - // A wrapper for BindGetterCallback, to simplify the common case of binding a - // property on the current object. Though not verified here, |method| - // must be a method of this CppBoundClass subclass. - template<typename T> - void BindProperty(const std::string& name, void (T::*method)(CppVariant*)) { - BindGetterCallback( - name, base::Bind(method, base::Unretained(static_cast<T*>(this)))); - } - // Bind the Javascript property called |name| to a CppVariant |prop|. void BindProperty(const std::string& name, CppVariant* prop); @@ -125,21 +105,6 @@ class CppBoundClass { fallback_callback_ = fallback_callback; } - // A wrapper for BindFallbackCallback, to simplify the common case of - // binding a method on the current object. Though not verified here, - // |method| must be a method of this CppBoundClass subclass. - // Passing NULL for |method| clears out any existing binding. - template<typename T> - void BindFallbackMethod( - void (T::*method)(const CppArgumentList&, CppVariant*)) { - if (method) { - BindFallbackCallback(base::Bind(method, - base::Unretained(static_cast<T*>(this)))); - } else { - BindFallbackCallback(Callback()); - } - } - // Some fields are protected because some tests depend on accessing them, // but otherwise they should be considered private. diff --git a/webkit/glue/cpp_bound_class_unittest.cc b/webkit/glue/cpp_bound_class_unittest.cc index fd6691f..0c97da5 100644 --- a/webkit/glue/cpp_bound_class_unittest.cc +++ b/webkit/glue/cpp_bound_class_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,8 @@ #include <vector> +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/message_loop.h" #include "base/string_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" @@ -40,9 +42,10 @@ class CppBindingExampleWithOptionalFallback : public CppBindingExample { } void set_fallback_method_enabled(bool state) { - BindFallbackMethod(state ? - &CppBindingExampleWithOptionalFallback::fallbackMethod - : NULL); + BindFallbackCallback(state ? + base::Bind(&CppBindingExampleWithOptionalFallback::fallbackMethod, + base::Unretained(this)) + : CppBoundClass::Callback()); } // The fallback method does nothing, but because of it the JavaScript keeps diff --git a/webkit/tools/test_shell/accessibility_ui_element.cc b/webkit/tools/test_shell/accessibility_ui_element.cc index 78988a9..79acc51 100644 --- a/webkit/tools/test_shell/accessibility_ui_element.cc +++ b/webkit/tools/test_shell/accessibility_ui_element.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObject.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" @@ -233,55 +235,109 @@ AccessibilityUIElement::AccessibilityUIElement( DCHECK(factory); - BindMethod("allAttributes", &AccessibilityUIElement::AllAttributesCallback); - BindMethod("attributesOfLinkedUIElements", - &AccessibilityUIElement::AttributesOfLinkedUIElementsCallback); - BindMethod("attributesOfDocumentLinks", - &AccessibilityUIElement::AttributesOfDocumentLinksCallback); - BindMethod("attributesOfChildren", - &AccessibilityUIElement::AttributesOfChildrenCallback); - BindMethod("parameterizedAttributeNames", - &AccessibilityUIElement::ParametrizedAttributeNamesCallback); - BindMethod("lineForIndex", &AccessibilityUIElement::LineForIndexCallback); - BindMethod("boundsForRange", &AccessibilityUIElement::BoundsForRangeCallback); - BindMethod("stringForRange", &AccessibilityUIElement::StringForRangeCallback); - BindMethod("childAtIndex", &AccessibilityUIElement::ChildAtIndexCallback); - BindMethod("elementAtPoint", &AccessibilityUIElement::ElementAtPointCallback); - BindMethod("attributesOfColumnHeaders", - &AccessibilityUIElement::AttributesOfColumnHeadersCallback); - BindMethod("attributesOfRowHeaders", - &AccessibilityUIElement::AttributesOfRowHeadersCallback); - BindMethod("attributesOfColumns", - &AccessibilityUIElement::AttributesOfColumnsCallback); - BindMethod("attributesOfRows", - &AccessibilityUIElement::AttributesOfRowsCallback); - BindMethod("attributesOfVisibleCells", - &AccessibilityUIElement::AttributesOfVisibleCellsCallback); - BindMethod("attributesOfHeader", - &AccessibilityUIElement::AttributesOfHeaderCallback); - BindMethod("indexInTable", &AccessibilityUIElement::IndexInTableCallback); - BindMethod("rowIndexRange", &AccessibilityUIElement::RowIndexRangeCallback); - BindMethod("columnIndexRange", - &AccessibilityUIElement::ColumnIndexRangeCallback); - BindMethod("cellForColumnAndRow", - &AccessibilityUIElement::CellForColumnAndRowCallback); - BindMethod("titleUIElement", &AccessibilityUIElement::TitleUIElementCallback); - BindMethod("setSelectedTextRange", - &AccessibilityUIElement::SetSelectedTextRangeCallback); - BindMethod("attributeValue", &AccessibilityUIElement::AttributeValueCallback); - BindMethod("isAttributeSettable", - &AccessibilityUIElement::IsAttributeSettableCallback); - BindMethod("isActionSupported", - &AccessibilityUIElement::IsActionSupportedCallback); - BindMethod("parentElement", &AccessibilityUIElement::ParentElementCallback); - BindMethod("increment", &AccessibilityUIElement::IncrementCallback); - BindMethod("decrement", &AccessibilityUIElement::DecrementCallback); - - BindProperty("role", &AccessibilityUIElement::RoleGetterCallback); + BindCallback("allAttributes", + base::Bind(&AccessibilityUIElement::AllAttributesCallback, + base::Unretained(this))); + BindCallback( + "attributesOfLinkedUIElements", + base::Bind(&AccessibilityUIElement::AttributesOfLinkedUIElementsCallback, + base::Unretained(this))); + BindCallback( + "attributesOfDocumentLinks", + base::Bind(&AccessibilityUIElement::AttributesOfDocumentLinksCallback, + base::Unretained(this))); + BindCallback( + "attributesOfChildren", + base::Bind(&AccessibilityUIElement::AttributesOfChildrenCallback, + base::Unretained(this))); + BindCallback( + "parameterizedAttributeNames", + base::Bind(&AccessibilityUIElement::ParametrizedAttributeNamesCallback, + base::Unretained(this))); + BindCallback("lineForIndex", + base::Bind(&AccessibilityUIElement::LineForIndexCallback, + base::Unretained(this))); + BindCallback("boundsForRange", + base::Bind(&AccessibilityUIElement::BoundsForRangeCallback, + base::Unretained(this))); + BindCallback("stringForRange", + base::Bind(&AccessibilityUIElement::StringForRangeCallback, + base::Unretained(this))); + BindCallback("childAtIndex", + base::Bind(&AccessibilityUIElement::ChildAtIndexCallback, + base::Unretained(this))); + BindCallback("elementAtPoint", + base::Bind(&AccessibilityUIElement::ElementAtPointCallback, + base::Unretained(this))); + BindCallback( + "attributesOfColumnHeaders", + base::Bind(&AccessibilityUIElement::AttributesOfColumnHeadersCallback, + base::Unretained(this))); + BindCallback( + "attributesOfRowHeaders", + base::Bind(&AccessibilityUIElement::AttributesOfRowHeadersCallback, + base::Unretained(this))); + BindCallback("attributesOfColumns", + base::Bind(&AccessibilityUIElement::AttributesOfColumnsCallback, + base::Unretained(this))); + BindCallback("attributesOfRows", + base::Bind(&AccessibilityUIElement::AttributesOfRowsCallback, + base::Unretained(this))); + BindCallback( + "attributesOfVisibleCells", + base::Bind(&AccessibilityUIElement::AttributesOfVisibleCellsCallback, + base::Unretained(this))); + BindCallback("attributesOfHeader", + base::Bind(&AccessibilityUIElement::AttributesOfHeaderCallback, + base::Unretained(this))); + BindCallback("indexInTable", + base::Bind(&AccessibilityUIElement::IndexInTableCallback, + base::Unretained(this))); + BindCallback("rowIndexRange", + base::Bind(&AccessibilityUIElement::RowIndexRangeCallback, + base::Unretained(this))); + BindCallback("columnIndexRange", + base::Bind(&AccessibilityUIElement::ColumnIndexRangeCallback, + base::Unretained(this))); + BindCallback("cellForColumnAndRow", + base::Bind(&AccessibilityUIElement::CellForColumnAndRowCallback, + base::Unretained(this))); + BindCallback("titleUIElement", + base::Bind(&AccessibilityUIElement::TitleUIElementCallback, + base::Unretained(this))); + BindCallback("setSelectedTextRange", + base::Bind(&AccessibilityUIElement::SetSelectedTextRangeCallback, + base::Unretained(this))); + BindCallback("attributeValue", + base::Bind(&AccessibilityUIElement::AttributeValueCallback, + base::Unretained(this))); + BindCallback("isAttributeSettable", + base::Bind(&AccessibilityUIElement::IsAttributeSettableCallback, + base::Unretained(this))); + BindCallback("isActionSupported", + base::Bind(&AccessibilityUIElement::IsActionSupportedCallback, + base::Unretained(this))); + BindCallback("parentElement", + base::Bind(&AccessibilityUIElement::ParentElementCallback, + base::Unretained(this))); + BindCallback("increment", + base::Bind(&AccessibilityUIElement::IncrementCallback, + base::Unretained(this))); + BindCallback("decrement", + base::Bind(&AccessibilityUIElement::DecrementCallback, + base::Unretained(this))); + + BindGetterCallback("role", + base::Bind(&AccessibilityUIElement::RoleGetterCallback, + base::Unretained(this))); BindProperty("subrole", &subrole_); - BindProperty("title", &AccessibilityUIElement::TitleGetterCallback); - BindProperty("description", - &AccessibilityUIElement::DescriptionGetterCallback); + BindGetterCallback("title", + base::Bind(&AccessibilityUIElement::TitleGetterCallback, + base::Unretained(this))); + BindGetterCallback( + "description", + base::Bind(&AccessibilityUIElement::DescriptionGetterCallback, + base::Unretained(this))); BindProperty("language", &language_); BindProperty("x", &x_); BindProperty("y", &y_); @@ -292,16 +348,25 @@ AccessibilityUIElement::AccessibilityUIElement( BindProperty("intValue", &int_value_); BindProperty("minValue", &min_value_); BindProperty("maxValue", &max_value_); - BindProperty("childrenCount", - &AccessibilityUIElement::ChildrenCountGetterCallback); + BindGetterCallback( + "childrenCount", + base::Bind(&AccessibilityUIElement::ChildrenCountGetterCallback, + base::Unretained(this))); BindProperty("insertionPointLineNumber", &insertion_point_line_number_); BindProperty("selectedTextRange", &selected_text_range); - BindProperty("isEnabled", &AccessibilityUIElement::IsEnabledGetterCallback); + BindGetterCallback( + "isEnabled", + base::Bind(&AccessibilityUIElement::IsEnabledGetterCallback, + base::Unretained(this))); BindProperty("isRequired", &is_required_); - BindProperty("isSelected", &AccessibilityUIElement::IsSelectedGetterCallback); + BindGetterCallback( + "isSelected", + base::Bind(&AccessibilityUIElement::IsSelectedGetterCallback, + base::Unretained(this))); BindProperty("valueDescription", &value_description_); - BindFallbackMethod(&AccessibilityUIElement::FallbackCallback); + BindFallbackCallback(base::Bind(&AccessibilityUIElement::FallbackCallback, + base::Unretained(this))); } AccessibilityUIElement::~AccessibilityUIElement() {} diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index c295aef..ce99a57 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,6 +11,7 @@ #include "base/base64.h" #include "base/basictypes.h" #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" @@ -81,11 +82,16 @@ LayoutTestController::LayoutTestController(TestShell* shell) : // they will use when called by JavaScript. The actual binding of those // names to their methods will be done by calling BindToJavaScript() (defined // by CppBoundClass, the parent to LayoutTestController). - BindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); - BindMethod("notifyDone", &LayoutTestController::notifyDone); + BindCallback("waitUntilDone", + base::Bind(&LayoutTestController::waitUntilDone, + base::Unretained(this))); + BindCallback("notifyDone", + base::Bind(&LayoutTestController::notifyDone, + base::Unretained(this))); // The fallback method is called when an unknown method is invoked. - BindFallbackMethod(&LayoutTestController::fallbackMethod); + BindFallbackCallback(base::Bind(&LayoutTestController::fallbackMethod, + base::Unretained(this))); } LayoutTestController::~LayoutTestController() { |