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/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "chrome/common/edit_command.h" | 18 #include "chrome/common/edit_command.h" |
19 #include "chrome/common/native_web_keyboard_event.h" | 19 #include "chrome/common/native_web_keyboard_event.h" |
20 #include "chrome/common/property_bag.h" | 20 #include "chrome/common/property_bag.h" |
21 #include "gfx/native_widget_types.h" | 21 #include "gfx/native_widget_types.h" |
| 22 #include "gfx/rect.h" |
22 #include "gfx/size.h" | 23 #include "gfx/size.h" |
23 #include "ipc/ipc_channel.h" | 24 #include "ipc/ipc_channel.h" |
24 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" | 26 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h" |
27 | 28 |
28 namespace gfx { | 29 namespace gfx { |
29 class Rect; | 30 class Rect; |
30 } | 31 } |
31 | 32 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // * when insertText of NSTextInput is called (on Mac). | 357 // * when insertText of NSTextInput is called (on Mac). |
357 void ImeConfirmComposition(const string16& text); | 358 void ImeConfirmComposition(const string16& text); |
358 | 359 |
359 // Finishes an ongoing composition with the composition text set by last | 360 // Finishes an ongoing composition with the composition text set by last |
360 // SetComposition() call. | 361 // SetComposition() call. |
361 void ImeConfirmComposition(); | 362 void ImeConfirmComposition(); |
362 | 363 |
363 // Cancels an ongoing composition. | 364 // Cancels an ongoing composition. |
364 void ImeCancelComposition(); | 365 void ImeCancelComposition(); |
365 | 366 |
366 // This is for derived classes to give us access to the resizer rect. | |
367 // And to also expose it to the RenderWidgetHostView. | |
368 virtual gfx::Rect GetRootWindowResizerRect() const; | |
369 | |
370 // Makes an IPC call to toggle the spelling panel. | 367 // Makes an IPC call to toggle the spelling panel. |
371 void ToggleSpellPanel(bool is_currently_visible); | 368 void ToggleSpellPanel(bool is_currently_visible); |
372 | 369 |
373 // Makes an IPC call to tell webkit to replace the currently selected word | 370 // Makes an IPC call to tell webkit to replace the currently selected word |
374 // or a word around the cursor. | 371 // or a word around the cursor. |
375 void Replace(const string16& word); | 372 void Replace(const string16& word); |
376 | 373 |
377 // Makes an IPC call to tell webkit to advance to the next misspelling. | 374 // Makes an IPC call to tell webkit to advance to the next misspelling. |
378 void AdvanceToNextMisspelling(); | 375 void AdvanceToNextMisspelling(); |
379 | 376 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 565 |
569 // Set if we are waiting for a repaint ack for the view. | 566 // Set if we are waiting for a repaint ack for the view. |
570 bool repaint_ack_pending_; | 567 bool repaint_ack_pending_; |
571 | 568 |
572 // True when waiting for RESIZE_ACK. | 569 // True when waiting for RESIZE_ACK. |
573 bool resize_ack_pending_; | 570 bool resize_ack_pending_; |
574 | 571 |
575 // The current size of the RenderWidget. | 572 // The current size of the RenderWidget. |
576 gfx::Size current_size_; | 573 gfx::Size current_size_; |
577 | 574 |
| 575 // The current reserved area of the RenderWidget where contents should not be |
| 576 // rendered to draw the resize corner, sidebar mini tabs etc. |
| 577 gfx::Rect current_reserved_rect_; |
| 578 |
578 // The size we last sent as requested size to the renderer. |current_size_| | 579 // The size we last sent as requested size to the renderer. |current_size_| |
579 // is only updated once the resize message has been ack'd. This on the other | 580 // is only updated once the resize message has been ack'd. This on the other |
580 // hand is updated when the resize message is sent. This is very similar to | 581 // hand is updated when the resize message is sent. This is very similar to |
581 // |resize_ack_pending_|, but the latter is not set if the new size has width | 582 // |resize_ack_pending_|, but the latter is not set if the new size has width |
582 // or height zero, which is why we need this too. | 583 // or height zero, which is why we need this too. |
583 gfx::Size in_flight_size_; | 584 gfx::Size in_flight_size_; |
584 | 585 |
| 586 // The reserved area we last sent to the renderer. |current_reserved_rect_| |
| 587 // is only updated once the resize message has been ack'd. This on the other |
| 588 // hand is updated when the resize message is sent. |
| 589 gfx::Rect in_flight_reserved_rect_; |
| 590 |
585 // True if a mouse move event was sent to the render view and we are waiting | 591 // True if a mouse move event was sent to the render view and we are waiting |
586 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. | 592 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. |
587 bool mouse_move_pending_; | 593 bool mouse_move_pending_; |
588 | 594 |
589 // The next mouse move event to send (only non-null while mouse_move_pending_ | 595 // The next mouse move event to send (only non-null while mouse_move_pending_ |
590 // is true). | 596 // is true). |
591 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; | 597 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; |
592 | 598 |
593 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent | 599 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent |
594 // and we are waiting for a corresponding ack. | 600 // and we are waiting for a corresponding ack. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // 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 |
670 // 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 |
671 // 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 |
672 // changed. | 678 // changed. |
673 bool suppress_next_char_events_; | 679 bool suppress_next_char_events_; |
674 | 680 |
675 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 681 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
676 }; | 682 }; |
677 | 683 |
678 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 684 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |