OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "app/surface/transport_dib.h" | 13 #include "app/surface/transport_dib.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/process_util.h" |
15 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
16 #include "base/string16.h" | 17 #include "base/string16.h" |
17 #include "base/timer.h" | 18 #include "base/timer.h" |
18 #include "chrome/common/edit_command.h" | 19 #include "chrome/common/edit_command.h" |
19 #include "chrome/common/native_web_keyboard_event.h" | 20 #include "chrome/common/native_web_keyboard_event.h" |
20 #include "chrome/common/property_bag.h" | 21 #include "chrome/common/property_bag.h" |
21 #include "gfx/native_widget_types.h" | 22 #include "gfx/native_widget_types.h" |
22 #include "gfx/rect.h" | 23 #include "gfx/rect.h" |
23 #include "gfx/size.h" | 24 #include "gfx/size.h" |
24 #include "ipc/ipc_channel.h" | 25 #include "ipc/ipc_channel.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 400 } |
400 | 401 |
401 protected: | 402 protected: |
402 // Internal implementation of the public Forward*Event() methods. | 403 // Internal implementation of the public Forward*Event() methods. |
403 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 404 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
404 int event_size, bool is_keyboard_shortcut); | 405 int event_size, bool is_keyboard_shortcut); |
405 | 406 |
406 // Called when we receive a notification indicating that the renderer | 407 // Called when we receive a notification indicating that the renderer |
407 // process has gone. This will reset our state so that our state will be | 408 // process has gone. This will reset our state so that our state will be |
408 // consistent if a new renderer is created. | 409 // consistent if a new renderer is created. |
409 void RendererExited(); | 410 void RendererExited(base::TerminationStatus status, int exit_code); |
410 | 411 |
411 // Retrieves an id the renderer can use to refer to its view. | 412 // Retrieves an id the renderer can use to refer to its view. |
412 // This is used for various IPC messages, including plugins. | 413 // This is used for various IPC messages, including plugins. |
413 gfx::NativeViewId GetNativeViewId(); | 414 gfx::NativeViewId GetNativeViewId(); |
414 | 415 |
415 // Called to handled a keyboard event before sending it to the renderer. | 416 // Called to handled a keyboard event before sending it to the renderer. |
416 // This is overridden by RenderView to send upwards to its delegate. | 417 // This is overridden by RenderView to send upwards to its delegate. |
417 // Returns true if the event was handled, and then the keyboard event will | 418 // Returns true if the event was handled, and then the keyboard event will |
418 // not be sent to the renderer anymore. Otherwise, if the |event| would | 419 // not be sent to the renderer anymore. Otherwise, if the |event| would |
419 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, | 420 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // if it is. | 460 // if it is. |
460 void CheckRendererIsUnresponsive(); | 461 void CheckRendererIsUnresponsive(); |
461 | 462 |
462 // Called if we know the renderer is responsive. When we currently think the | 463 // Called if we know the renderer is responsive. When we currently think the |
463 // renderer is unresponsive, this will clear that state and call | 464 // renderer is unresponsive, this will clear that state and call |
464 // NotifyRendererResponsive. | 465 // NotifyRendererResponsive. |
465 void RendererIsResponsive(); | 466 void RendererIsResponsive(); |
466 | 467 |
467 // IPC message handlers | 468 // IPC message handlers |
468 void OnMsgRenderViewReady(); | 469 void OnMsgRenderViewReady(); |
469 void OnMsgRenderViewGone(); | 470 void OnMsgRenderViewGone(int status, int error_code); |
470 void OnMsgClose(); | 471 void OnMsgClose(); |
471 void OnMsgRequestMove(const gfx::Rect& pos); | 472 void OnMsgRequestMove(const gfx::Rect& pos); |
472 void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size); | 473 void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size); |
473 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 474 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
474 void OnMsgInputEventAck(const IPC::Message& message); | 475 void OnMsgInputEventAck(const IPC::Message& message); |
475 virtual void OnMsgFocus(); | 476 virtual void OnMsgFocus(); |
476 virtual void OnMsgBlur(); | 477 virtual void OnMsgBlur(); |
477 | 478 |
478 void OnMsgSetCursor(const WebCursor& cursor); | 479 void OnMsgSetCursor(const WebCursor& cursor); |
479 void OnMsgImeUpdateTextInputState(WebKit::WebTextInputType type, | 480 void OnMsgImeUpdateTextInputState(WebKit::WebTextInputType type, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 // but the Char event generated by alt-2 may also activate a HTML element | 675 // but the Char event generated by alt-2 may also activate a HTML element |
675 // if its accesskey happens to be "2", then the user may get confused when | 676 // if its accesskey happens to be "2", then the user may get confused when |
676 // switching back to the original tab, because the content may already be | 677 // switching back to the original tab, because the content may already be |
677 // changed. | 678 // changed. |
678 bool suppress_next_char_events_; | 679 bool suppress_next_char_events_; |
679 | 680 |
680 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 681 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
681 }; | 682 }; |
682 | 683 |
683 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 684 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |