Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: content/browser/renderer_host/render_view_host.h

Issue 8124024: Applescript: return value from execute javascript command (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed issues Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/process_util.h" 16 #include "base/process_util.h"
17 #include "content/browser/renderer_host/render_widget_host.h" 17 #include "content/browser/renderer_host/render_widget_host.h"
18 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/common/window_container_type.h" 19 #include "content/common/window_container_type.h"
20 #include "net/base/load_states.h" 20 #include "net/base/load_states.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
25 #include "webkit/glue/webaccessibility.h" 25 #include "webkit/glue/webaccessibility.h"
26 #include "webkit/glue/window_open_disposition.h" 26 #include "webkit/glue/window_open_disposition.h"
27 27
28 #include "base/values.h"
29 #include "content/common/notification_observer.h"
30
28 class ChildProcessSecurityPolicy; 31 class ChildProcessSecurityPolicy;
29 struct DesktopNotificationHostMsg_Show_Params; 32 struct DesktopNotificationHostMsg_Show_Params;
30 class FilePath; 33 class FilePath;
31 class GURL; 34 class GURL;
32 class RenderViewHostDelegate; 35 class RenderViewHostDelegate;
33 class RenderViewHostObserver; 36 class RenderViewHostObserver;
34 class SessionStorageNamespace; 37 class SessionStorageNamespace;
35 class SiteInstance; 38 class SiteInstance;
36 class SkBitmap; 39 class SkBitmap;
37 class ViewMsg_Navigate; 40 class ViewMsg_Navigate;
(...skipping 27 matching lines...) Expand all
65 68
66 namespace WebKit { 69 namespace WebKit {
67 struct WebMediaPlayerAction; 70 struct WebMediaPlayerAction;
68 struct WebFindOptions; 71 struct WebFindOptions;
69 } // namespace WebKit 72 } // namespace WebKit
70 73
71 namespace net { 74 namespace net {
72 class URLRequestContextGetter; 75 class URLRequestContextGetter;
73 } 76 }
74 77
78 // NotificationObserver used to listen for EXECUTE_JAVASCRIPT_RESULT
79 // notifications.
80 class ExecuteNotificationObserver : public NotificationObserver {
81 public:
82 ExecuteNotificationObserver(int id);
Avi (use Gerrit) 2011/10/17 14:20:38 one param constructors should be "explicit"
keishi 2011/10/21 05:05:43 Done.
83 virtual ~ExecuteNotificationObserver();
84 virtual void Observe(int type,
85 const NotificationSource& source,
86 const NotificationDetails& details);
87
88 int id() const { return id_; }
89
90 Value* value() const { return value_.get(); }
91
92 private:
93 int id_;
94 scoped_ptr<Value> value_;
95
96 DISALLOW_COPY_AND_ASSIGN(ExecuteNotificationObserver);
97 };
98
75 // 99 //
76 // RenderViewHost 100 // RenderViewHost
77 // 101 //
78 // A RenderViewHost is responsible for creating and talking to a RenderView 102 // A RenderViewHost is responsible for creating and talking to a RenderView
79 // object in a child process. It exposes a high level API to users, for things 103 // object in a child process. It exposes a high level API to users, for things
80 // like loading pages, adjusting the display and other browser functionality, 104 // like loading pages, adjusting the display and other browser functionality,
81 // which it translates into IPC messages sent over the IPC channel with the 105 // which it translates into IPC messages sent over the IPC channel with the
82 // RenderView. It responds to all IPC messages sent by that RenderView and 106 // RenderView. It responds to all IPC messages sent by that RenderView and
83 // cracks them, calling a delegate object back with higher level types where 107 // cracks them, calling a delegate object back with higher level types where
84 // possible. 108 // possible.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 275
252 // Runs some javascript within the context of a frame in the page. 276 // Runs some javascript within the context of a frame in the page.
253 void ExecuteJavascriptInWebFrame(const string16& frame_xpath, 277 void ExecuteJavascriptInWebFrame(const string16& frame_xpath,
254 const string16& jscript); 278 const string16& jscript);
255 279
256 // Runs some javascript within the context of a frame in the page. The result 280 // Runs some javascript within the context of a frame in the page. The result
257 // is sent back via the notification EXECUTE_JAVASCRIPT_RESULT. 281 // is sent back via the notification EXECUTE_JAVASCRIPT_RESULT.
258 int ExecuteJavascriptInWebFrameNotifyResult(const string16& frame_xpath, 282 int ExecuteJavascriptInWebFrameNotifyResult(const string16& frame_xpath,
259 const string16& jscript); 283 const string16& jscript);
260 284
285 Value* ExecuteJavascriptAndGetValue(const string16& frame_xpath,
286 const string16& jscript);
Avi (use Gerrit) 2011/10/17 14:20:38 align params, add comment; do we want to merge thi
keishi 2011/10/21 05:05:43 Do you want me to add an argument to ExecuteJavasc
Avi (use Gerrit) 2011/10/21 11:50:48 hmmmm... What fraction of the users bother to set
287
288
261 // Notifies the RenderView that the JavaScript message that was shown was 289 // Notifies the RenderView that the JavaScript message that was shown was
262 // closed by the user. 290 // closed by the user.
263 void JavaScriptDialogClosed(IPC::Message* reply_msg, 291 void JavaScriptDialogClosed(IPC::Message* reply_msg,
264 bool success, 292 bool success,
265 const string16& user_input); 293 const string16& user_input);
266 294
267 // Notifies the renderer that a a drag operation that it started has ended, 295 // Notifies the renderer that a a drag operation that it started has ended,
268 // either in a drop or by being cancelled. 296 // either in a drop or by being cancelled.
269 void DragSourceEndedAt( 297 void DragSourceEndedAt(
270 int client_x, int client_y, int screen_x, int screen_y, 298 int client_x, int client_y, int screen_x, int screen_y,
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // The termination status of the last render view that terminated. 660 // The termination status of the last render view that terminated.
633 base::TerminationStatus render_view_termination_status_; 661 base::TerminationStatus render_view_termination_status_;
634 662
635 // A list of observers that filter messages. Weak references. 663 // A list of observers that filter messages. Weak references.
636 ObserverList<RenderViewHostObserver> observers_; 664 ObserverList<RenderViewHostObserver> observers_;
637 665
638 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); 666 DISALLOW_COPY_AND_ASSIGN(RenderViewHost);
639 }; 667 };
640 668
641 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ 669 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698