| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
| 18 #include "base/property_bag.h" | 18 #include "base/property_bag.h" |
| 19 #include "base/string16.h" | 19 #include "base/string16.h" |
| 20 #include "base/timer.h" | 20 #include "base/timer.h" |
| 21 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 22 #include "content/public/browser/native_web_keyboard_event.h" | 22 #include "content/public/browser/native_web_keyboard_event.h" |
| 23 #include "content/public/common/page_zoom.h" | 23 #include "content/public/common/page_zoom.h" |
| 24 #include "ipc/ipc_channel.h" | 24 #include "ipc/ipc_channel.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 27 #include "ui/base/ime/text_input_type.h" | 27 #include "ui/base/ime/text_input_type.h" |
| 28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 29 #include "ui/gfx/rect.h" | |
| 30 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
| 31 #include "ui/gfx/surface/transport_dib.h" | 30 #include "ui/gfx/surface/transport_dib.h" |
| 32 | 31 |
| 33 class BackingStore; | 32 class BackingStore; |
| 34 struct EditCommand; | 33 struct EditCommand; |
| 35 class RenderWidgetHostView; | 34 class RenderWidgetHostView; |
| 36 class TransportDIB; | 35 class TransportDIB; |
| 37 struct ViewHostMsg_UpdateRect_Params; | 36 struct ViewHostMsg_UpdateRect_Params; |
| 38 class WebCursor; | 37 class WebCursor; |
| 39 | 38 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 void ImeConfirmComposition(const string16& text, | 365 void ImeConfirmComposition(const string16& text, |
| 367 const ui::Range& replacement_range); | 366 const ui::Range& replacement_range); |
| 368 | 367 |
| 369 // Finishes an ongoing composition with the composition text set by last | 368 // Finishes an ongoing composition with the composition text set by last |
| 370 // SetComposition() call. | 369 // SetComposition() call. |
| 371 void ImeConfirmComposition(); | 370 void ImeConfirmComposition(); |
| 372 | 371 |
| 373 // Cancels an ongoing composition. | 372 // Cancels an ongoing composition. |
| 374 void ImeCancelComposition(); | 373 void ImeCancelComposition(); |
| 375 | 374 |
| 375 // This is for derived classes to give us access to the resizer rect. |
| 376 // And to also expose it to the RenderWidgetHostView. |
| 377 virtual gfx::Rect GetRootWindowResizerRect() const; |
| 378 |
| 376 // Makes an IPC call to tell webkit to replace the currently selected word | 379 // Makes an IPC call to tell webkit to replace the currently selected word |
| 377 // or a word around the cursor. | 380 // or a word around the cursor. |
| 378 void Replace(const string16& word); | 381 void Replace(const string16& word); |
| 379 | 382 |
| 380 // Enable renderer accessibility. This should only be called when a | 383 // Enable renderer accessibility. This should only be called when a |
| 381 // screenreader is detected. | 384 // screenreader is detected. |
| 382 void EnableRendererAccessibility(); | 385 void EnableRendererAccessibility(); |
| 383 | 386 |
| 384 void set_ignore_input_events(bool ignore_input_events) { | 387 void set_ignore_input_events(bool ignore_input_events) { |
| 385 ignore_input_events_ = ignore_input_events; | 388 ignore_input_events_ = ignore_input_events; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 | 672 |
| 670 // Set if we are waiting for a repaint ack for the view. | 673 // Set if we are waiting for a repaint ack for the view. |
| 671 bool repaint_ack_pending_; | 674 bool repaint_ack_pending_; |
| 672 | 675 |
| 673 // True when waiting for RESIZE_ACK. | 676 // True when waiting for RESIZE_ACK. |
| 674 bool resize_ack_pending_; | 677 bool resize_ack_pending_; |
| 675 | 678 |
| 676 // The current size of the RenderWidget. | 679 // The current size of the RenderWidget. |
| 677 gfx::Size current_size_; | 680 gfx::Size current_size_; |
| 678 | 681 |
| 679 // The current reserved area of the RenderWidget where contents should not be | |
| 680 // rendered to draw the resize corner, sidebar mini tabs etc. | |
| 681 gfx::Rect current_reserved_rect_; | |
| 682 | |
| 683 // The size we last sent as requested size to the renderer. |current_size_| | 682 // The size we last sent as requested size to the renderer. |current_size_| |
| 684 // is only updated once the resize message has been ack'd. This on the other | 683 // is only updated once the resize message has been ack'd. This on the other |
| 685 // hand is updated when the resize message is sent. This is very similar to | 684 // hand is updated when the resize message is sent. This is very similar to |
| 686 // |resize_ack_pending_|, but the latter is not set if the new size has width | 685 // |resize_ack_pending_|, but the latter is not set if the new size has width |
| 687 // or height zero, which is why we need this too. | 686 // or height zero, which is why we need this too. |
| 688 gfx::Size in_flight_size_; | 687 gfx::Size in_flight_size_; |
| 689 | 688 |
| 690 // The reserved area we last sent to the renderer. |current_reserved_rect_| | |
| 691 // is only updated once the resize message has been ack'd. This on the other | |
| 692 // hand is updated when the resize message is sent. | |
| 693 gfx::Rect in_flight_reserved_rect_; | |
| 694 | |
| 695 // True if the render widget host should track the render widget's size as | 689 // True if the render widget host should track the render widget's size as |
| 696 // opposed to visa versa. | 690 // opposed to visa versa. |
| 697 bool should_auto_resize_; | 691 bool should_auto_resize_; |
| 698 | 692 |
| 699 // True if a mouse move event was sent to the render view and we are waiting | 693 // True if a mouse move event was sent to the render view and we are waiting |
| 700 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. | 694 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. |
| 701 bool mouse_move_pending_; | 695 bool mouse_move_pending_; |
| 702 | 696 |
| 703 // The next mouse move event to send (only non-null while mouse_move_pending_ | 697 // The next mouse move event to send (only non-null while mouse_move_pending_ |
| 704 // is true). | 698 // is true). |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 gfx::Point last_scroll_offset_; | 797 gfx::Point last_scroll_offset_; |
| 804 | 798 |
| 805 bool pending_mouse_lock_request_; | 799 bool pending_mouse_lock_request_; |
| 806 | 800 |
| 807 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; | 801 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; |
| 808 | 802 |
| 809 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 803 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
| 810 }; | 804 }; |
| 811 | 805 |
| 812 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 806 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |