OLD | NEW |
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 "base/values.h" |
17 #include "content/browser/renderer_host/render_widget_host.h" | 18 #include "content/browser/renderer_host/render_widget_host.h" |
18 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/notification_observer.h" |
19 #include "content/public/common/window_container_type.h" | 21 #include "content/public/common/window_container_type.h" |
20 #include "net/base/load_states.h" | 22 #include "net/base/load_states.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
25 #include "webkit/glue/webaccessibility.h" | 27 #include "webkit/glue/webaccessibility.h" |
26 #include "webkit/glue/window_open_disposition.h" | 28 #include "webkit/glue/window_open_disposition.h" |
27 | 29 |
28 class ChildProcessSecurityPolicy; | 30 class ChildProcessSecurityPolicy; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 68 |
67 namespace WebKit { | 69 namespace WebKit { |
68 struct WebMediaPlayerAction; | 70 struct WebMediaPlayerAction; |
69 struct WebFindOptions; | 71 struct WebFindOptions; |
70 } // namespace WebKit | 72 } // namespace WebKit |
71 | 73 |
72 namespace net { | 74 namespace net { |
73 class URLRequestContextGetter; | 75 class URLRequestContextGetter; |
74 } | 76 } |
75 | 77 |
| 78 // NotificationObserver used to listen for EXECUTE_JAVASCRIPT_RESULT |
| 79 // notifications. |
| 80 class ExecuteNotificationObserver : public content::NotificationObserver { |
| 81 public: |
| 82 explicit ExecuteNotificationObserver(int id); |
| 83 virtual ~ExecuteNotificationObserver(); |
| 84 virtual void Observe(int type, |
| 85 const content::NotificationSource& source, |
| 86 const content::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 |
76 // | 99 // |
77 // RenderViewHost | 100 // RenderViewHost |
78 // | 101 // |
79 // A RenderViewHost is responsible for creating and talking to a RenderView | 102 // A RenderViewHost is responsible for creating and talking to a RenderView |
80 // 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 |
81 // like loading pages, adjusting the display and other browser functionality, | 104 // like loading pages, adjusting the display and other browser functionality, |
82 // 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 |
83 // 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 |
84 // 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 |
85 // possible. | 108 // possible. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 275 |
253 // 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. |
254 void ExecuteJavascriptInWebFrame(const string16& frame_xpath, | 277 void ExecuteJavascriptInWebFrame(const string16& frame_xpath, |
255 const string16& jscript); | 278 const string16& jscript); |
256 | 279 |
257 // 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 |
258 // is sent back via the notification EXECUTE_JAVASCRIPT_RESULT. | 281 // is sent back via the notification EXECUTE_JAVASCRIPT_RESULT. |
259 int ExecuteJavascriptInWebFrameNotifyResult(const string16& frame_xpath, | 282 int ExecuteJavascriptInWebFrameNotifyResult(const string16& frame_xpath, |
260 const string16& jscript); | 283 const string16& jscript); |
261 | 284 |
| 285 Value* ExecuteJavascriptAndGetValue(const string16& frame_xpath, |
| 286 const string16& jscript); |
| 287 |
| 288 |
262 // Notifies the RenderView that the JavaScript message that was shown was | 289 // Notifies the RenderView that the JavaScript message that was shown was |
263 // closed by the user. | 290 // closed by the user. |
264 void JavaScriptDialogClosed(IPC::Message* reply_msg, | 291 void JavaScriptDialogClosed(IPC::Message* reply_msg, |
265 bool success, | 292 bool success, |
266 const string16& user_input); | 293 const string16& user_input); |
267 | 294 |
268 // 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, |
269 // either in a drop or by being cancelled. | 296 // either in a drop or by being cancelled. |
270 void DragSourceEndedAt( | 297 void DragSourceEndedAt( |
271 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 typedef std::map<int64, PowerSaveBlocker*> PowerSaveBlockerMap; | 671 typedef std::map<int64, PowerSaveBlocker*> PowerSaveBlockerMap; |
645 PowerSaveBlockerMap power_save_blockers_; | 672 PowerSaveBlockerMap power_save_blockers_; |
646 | 673 |
647 // A list of observers that filter messages. Weak references. | 674 // A list of observers that filter messages. Weak references. |
648 ObserverList<RenderViewHostObserver> observers_; | 675 ObserverList<RenderViewHostObserver> observers_; |
649 | 676 |
650 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 677 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
651 }; | 678 }; |
652 | 679 |
653 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 680 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
OLD | NEW |