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_WIDGET_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace ui { | 35 namespace ui { |
36 class Range; | 36 class Range; |
37 } | 37 } |
38 | 38 |
39 namespace WebKit { | 39 namespace WebKit { |
40 class WebInputEvent; | 40 class WebInputEvent; |
41 class WebMouseEvent; | 41 class WebMouseEvent; |
42 struct WebCompositionUnderline; | 42 struct WebCompositionUnderline; |
43 struct WebScreenInfo; | 43 struct WebScreenInfo; |
44 struct WebFindOptions; | |
45 } | 44 } |
46 | 45 |
47 class BackingStore; | 46 class BackingStore; |
48 class PaintObserver; | 47 class PaintObserver; |
49 class RenderProcessHost; | 48 class RenderProcessHost; |
50 class RenderWidgetHostView; | 49 class RenderWidgetHostView; |
51 class TransportDIB; | 50 class TransportDIB; |
52 class WebCursor; | 51 class WebCursor; |
53 struct ViewHostMsg_UpdateRect_Params; | 52 struct ViewHostMsg_UpdateRect_Params; |
| 53 struct WebPreferences; |
| 54 struct EditCommand; |
| 55 class GURL; |
54 | 56 |
55 // This class manages the browser side of a browser<->renderer HWND connection. | 57 // This class manages the browser side of a browser<->renderer HWND connection. |
56 // The HWND lives in the browser process, and windows events are sent over | 58 // The HWND lives in the browser process, and windows events are sent over |
57 // IPC to the corresponding object in the renderer. The renderer paints into | 59 // IPC to the corresponding object in the renderer. The renderer paints into |
58 // shared memory, which we transfer to a backing store and blit to the screen | 60 // shared memory, which we transfer to a backing store and blit to the screen |
59 // when Windows sends us a WM_PAINT message. | 61 // when Windows sends us a WM_PAINT message. |
60 // | 62 // |
61 // How Shutdown Works | 63 // How Shutdown Works |
62 // | 64 // |
63 // There are two situations in which this object, a RenderWidgetHost, can be | 65 // There are two situations in which this object, a RenderWidgetHost, can be |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 370 |
369 // Activate deferred plugin handles. | 371 // Activate deferred plugin handles. |
370 void ActivateDeferredPluginHandles(); | 372 void ActivateDeferredPluginHandles(); |
371 | 373 |
372 const gfx::Point& last_scroll_offset() const { return last_scroll_offset_; } | 374 const gfx::Point& last_scroll_offset() const { return last_scroll_offset_; } |
373 | 375 |
374 // Notification that the user has made some kind of input that could | 376 // Notification that the user has made some kind of input that could |
375 // perform an action. See OnUserGesture for more details. | 377 // perform an action. See OnUserGesture for more details. |
376 void StartUserGesture(); | 378 void StartUserGesture(); |
377 | 379 |
378 // Changes the zoom level for the current main frame. | |
379 void Zoom(PageZoom::Function zoom_function); | |
380 | |
381 // Reloads the current focused frame. | |
382 void ReloadFrame(); | |
383 | |
384 // Finds text on a page. | |
385 void Find(int request_id, const string16& search_text, | |
386 const WebKit::WebFindOptions& options); | |
387 | |
388 // Stops loading the page. | 380 // Stops loading the page. |
389 void Stop(); | 381 void Stop(); |
390 | 382 |
391 // Requests the renderer to evaluate an xpath to a frame and insert css | 383 // Set the RenderView background. |
392 // into that frame's document. | 384 void SetBackground(const SkBitmap& background); |
393 void InsertCSS(const string16& frame_xpath, const std::string& css); | |
394 | 385 |
395 // Tells the renderer not to add scrollbars with height and width below a | 386 // Notifies the renderer that the next key event is bound to one or more |
396 // threshold. | 387 // pre-defined edit commands |
397 void DisableScrollbarsForThreshold(const gfx::Size& size); | 388 void SetEditCommandsForNextKeyEvent( |
| 389 const std::vector<EditCommand>& commands); |
398 | 390 |
399 // Instructs the RenderView to send back updates to the preferred size. | 391 // Relay a request from assistive technology to perform the default action |
400 void EnablePreferredSizeMode(int flags); | 392 // on a given node. |
| 393 void AccessibilityDoDefaultAction(int object_id); |
| 394 |
| 395 // Relay a request from assistive technology to set focus to a given node. |
| 396 void AccessibilitySetFocus(int object_id); |
| 397 |
| 398 // Executes the edit command on the RenderView. |
| 399 void ExecuteEditCommand(const std::string& command, |
| 400 const std::string& value); |
| 401 |
| 402 // Tells the renderer to scroll the currently focused node into rect only if |
| 403 // the currently focused node is a Text node (textfield, text area or content |
| 404 // editable divs). |
| 405 void ScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); |
| 406 |
| 407 // Requests the renderer to select the region between two points. |
| 408 void SelectRange(const gfx::Point& start, const gfx::Point& end); |
| 409 |
| 410 // Edit operations. |
| 411 void Undo(); |
| 412 void Redo(); |
| 413 void Cut(); |
| 414 void Copy(); |
| 415 void CopyToFindPboard(); |
| 416 void Paste(); |
| 417 void Delete(); |
| 418 void SelectAll(); |
401 | 419 |
402 protected: | 420 protected: |
403 // Internal implementation of the public Forward*Event() methods. | 421 // Internal implementation of the public Forward*Event() methods. |
404 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 422 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
405 int event_size, bool is_keyboard_shortcut); | 423 int event_size, bool is_keyboard_shortcut); |
406 | 424 |
407 // Called when we receive a notification indicating that the renderer | 425 // Called when we receive a notification indicating that the renderer |
408 // process has gone. This will reset our state so that our state will be | 426 // process has gone. This will reset our state so that our state will be |
409 // consistent if a new renderer is created. | 427 // consistent if a new renderer is created. |
410 void RendererExited(base::TerminationStatus status, int exit_code); | 428 void RendererExited(base::TerminationStatus status, int exit_code); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 | 719 |
702 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; | 720 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; |
703 | 721 |
704 // The last scroll offset of the render widget. | 722 // The last scroll offset of the render widget. |
705 gfx::Point last_scroll_offset_; | 723 gfx::Point last_scroll_offset_; |
706 | 724 |
707 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 725 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
708 }; | 726 }; |
709 | 727 |
710 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 728 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |