Index: content/browser/renderer_host/render_view_host.h |
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h |
index 516be59c84cf63622508dc97aa086ab2653eb94b..a295822b04dc0890e6d2f166d2e5fd19716d3dcc 100644 |
--- a/content/browser/renderer_host/render_view_host.h |
+++ b/content/browser/renderer_host/render_view_host.h |
@@ -14,8 +14,10 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/observer_list.h" |
#include "base/process_util.h" |
+#include "base/values.h" |
#include "content/browser/renderer_host/render_widget_host.h" |
#include "content/common/content_export.h" |
+#include "content/public/browser/notification_observer.h" |
#include "content/public/common/window_container_type.h" |
#include "net/base/load_states.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
@@ -73,6 +75,27 @@ namespace net { |
class URLRequestContextGetter; |
} |
+// NotificationObserver used to listen for EXECUTE_JAVASCRIPT_RESULT |
+// notifications. |
+class ExecuteNotificationObserver : public content::NotificationObserver { |
+ public: |
+ explicit ExecuteNotificationObserver(int id); |
+ virtual ~ExecuteNotificationObserver(); |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details); |
+ |
+ int id() const { return id_; } |
+ |
+ Value* value() const { return value_.get(); } |
+ |
+ private: |
+ int id_; |
+ scoped_ptr<Value> value_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ExecuteNotificationObserver); |
+}; |
+ |
// |
// RenderViewHost |
// |
@@ -259,6 +282,10 @@ class CONTENT_EXPORT RenderViewHost : public RenderWidgetHost { |
int ExecuteJavascriptInWebFrameNotifyResult(const string16& frame_xpath, |
const string16& jscript); |
+ Value* ExecuteJavascriptAndGetValue(const string16& frame_xpath, |
+ const string16& jscript); |
+ |
+ |
// Notifies the RenderView that the JavaScript message that was shown was |
// closed by the user. |
void JavaScriptDialogClosed(IPC::Message* reply_msg, |