Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_gtk.h

Issue 10316010: Revert 135020 - Add initial GTK web accessibility framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_VIEW_GTK_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gdk/gdk.h> 9 #include <gdk/gdk.h>
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "content/browser/accessibility/browser_accessibility_manager.h"
17 #include "content/browser/renderer_host/render_widget_host_view_base.h" 16 #include "content/browser/renderer_host/render_widget_host_view_base.h"
18 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
19 #include "ui/base/animation/animation_delegate.h" 18 #include "ui/base/animation/animation_delegate.h"
20 #include "ui/base/animation/slide_animation.h" 19 #include "ui/base/animation/slide_animation.h"
21 #include "ui/base/gtk/gtk_signal.h" 20 #include "ui/base/gtk/gtk_signal.h"
22 #include "ui/base/gtk/gtk_signal_registrar.h" 21 #include "ui/base/gtk/gtk_signal_registrar.h"
23 #include "ui/base/gtk/owned_widget_gtk.h" 22 #include "ui/base/gtk/owned_widget_gtk.h"
24 #include "ui/gfx/native_widget_types.h" 23 #include "ui/gfx/native_widget_types.h"
25 #include "ui/gfx/point.h" 24 #include "ui/gfx/point.h"
26 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
27 #include "webkit/glue/webcursor.h" 26 #include "webkit/glue/webcursor.h"
28 #include "webkit/plugins/npapi/gtk_plugin_container_manager.h" 27 #include "webkit/plugins/npapi/gtk_plugin_container_manager.h"
29 28
30 class GtkIMContextWrapper; 29 class GtkIMContextWrapper;
31 struct NativeWebKeyboardEvent; 30 struct NativeWebKeyboardEvent;
32 31
33 namespace content { 32 namespace content {
34 class RenderWidgetHost; 33 class RenderWidgetHost;
35 class RenderWidgetHostImpl; 34 class RenderWidgetHostImpl;
36 } 35 }
37 36
38 class GtkKeyBindingsHandler; 37 class GtkKeyBindingsHandler;
39 38
40 typedef struct _GtkClipboard GtkClipboard; 39 typedef struct _GtkClipboard GtkClipboard;
41 typedef struct _GtkSelectionData GtkSelectionData; 40 typedef struct _GtkSelectionData GtkSelectionData;
42 41
43 // ----------------------------------------------------------------------------- 42 // -----------------------------------------------------------------------------
44 // See comments in render_widget_host_view.h about this class and its members. 43 // See comments in render_widget_host_view.h about this class and its members.
45 // ----------------------------------------------------------------------------- 44 // -----------------------------------------------------------------------------
46 class CONTENT_EXPORT RenderWidgetHostViewGtk 45 class RenderWidgetHostViewGtk : public content::RenderWidgetHostViewBase {
47 : public content::RenderWidgetHostViewBase,
48 public BrowserAccessibilityDelegate {
49 public: 46 public:
50 virtual ~RenderWidgetHostViewGtk(); 47 virtual ~RenderWidgetHostViewGtk();
51 48
52 // RenderWidgetHostView implementation. 49 // RenderWidgetHostView implementation.
53 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 50 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
54 virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; 51 virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
55 virtual void SetSize(const gfx::Size& size) OVERRIDE; 52 virtual void SetSize(const gfx::Size& size) OVERRIDE;
56 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; 53 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE;
57 virtual gfx::NativeView GetNativeView() const OVERRIDE; 54 virtual gfx::NativeView GetNativeView() const OVERRIDE;
58 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; 55 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool processed) OVERRIDE; 115 bool processed) OVERRIDE;
119 virtual void SetHasHorizontalScrollbar( 116 virtual void SetHasHorizontalScrollbar(
120 bool has_horizontal_scrollbar) OVERRIDE; 117 bool has_horizontal_scrollbar) OVERRIDE;
121 virtual void SetScrollOffsetPinning( 118 virtual void SetScrollOffsetPinning(
122 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; 119 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
123 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; 120 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE;
124 virtual gfx::Rect GetRootWindowBounds() OVERRIDE; 121 virtual gfx::Rect GetRootWindowBounds() OVERRIDE;
125 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; 122 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
126 virtual bool LockMouse() OVERRIDE; 123 virtual bool LockMouse() OVERRIDE;
127 virtual void UnlockMouse() OVERRIDE; 124 virtual void UnlockMouse() OVERRIDE;
128 virtual void OnAccessibilityNotifications(
129 const std::vector<AccessibilityHostMsg_NotificationParams>& params)
130 OVERRIDE;
131 125
132 // If the widget is aligned with an edge of the monitor its on and the user 126 // If the widget is aligned with an edge of the monitor its on and the user
133 // attempts to drag past that edge we track the number of times it has 127 // attempts to drag past that edge we track the number of times it has
134 // occurred, so that we can force the widget to scroll when it otherwise 128 // occurred, so that we can force the widget to scroll when it otherwise
135 // would be unable to. 129 // would be unable to.
136 void ModifyEventForEdgeDragging(GtkWidget* widget, GdkEventMotion* event); 130 void ModifyEventForEdgeDragging(GtkWidget* widget, GdkEventMotion* event);
137 131
138 // Mouse events always provide a movementX/Y which needs to be computed. 132 // Mouse events always provide a movementX/Y which needs to be computed.
139 // Also, mouse lock requires knowledge of last unlocked cursor coordinates. 133 // Also, mouse lock requires knowledge of last unlocked cursor coordinates.
140 // State is stored on the host view to do this, and the mouse event modified. 134 // State is stored on the host view to do this, and the mouse event modified.
141 void ModifyEventMovementAndCoords(WebKit::WebMouseEvent* event); 135 void ModifyEventMovementAndCoords(WebKit::WebMouseEvent* event);
142 136
143 void Paint(const gfx::Rect&); 137 void Paint(const gfx::Rect&);
144 138
145 // Called by GtkIMContextWrapper to forward a keyboard event to renderer. 139 // Called by GtkIMContextWrapper to forward a keyboard event to renderer.
146 // On Linux (not ChromeOS): 140 // On Linux (not ChromeOS):
147 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method 141 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method
148 // calls GtkKeyBindingsHandler::Match() against the event and send matched 142 // calls GtkKeyBindingsHandler::Match() against the event and send matched
149 // edit commands to renderer by calling 143 // edit commands to renderer by calling
150 // RenderWidgetHost::ForwardEditCommandsForNextKeyEvent(). 144 // RenderWidgetHost::ForwardEditCommandsForNextKeyEvent().
151 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); 145 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event);
152 146
153 bool RetrieveSurrounding(std::string* text, size_t* cursor_index); 147 bool RetrieveSurrounding(std::string* text, size_t* cursor_index);
154 148
155 // BrowserAccessibilityDelegate implementation.
156 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE;
157 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE;
158 virtual void AccessibilityScrollToMakeVisible(
159 int acc_obj_id, gfx::Rect subfocus) OVERRIDE;
160 virtual void AccessibilityScrollToPoint(
161 int acc_obj_id, gfx::Point point) OVERRIDE;
162 virtual void AccessibilitySetTextSelection(
163 int acc_obj_id, int start_offset, int end_offset) OVERRIDE;
164
165 // Get the root of the AtkObject* tree for accessibility.
166 AtkObject* GetAccessible();
167
168 protected: 149 protected:
169 friend class content::RenderWidgetHostView; 150 friend class content::RenderWidgetHostView;
170 151
171 // Should construct only via RenderWidgetHostView::CreateViewForWidget. 152 // Should construct only via RenderWidgetHostView::CreateViewForWidget.
172 explicit RenderWidgetHostViewGtk(content::RenderWidgetHost* widget); 153 explicit RenderWidgetHostViewGtk(content::RenderWidgetHost* widget);
173 154
174 private: 155 private:
175 friend class RenderWidgetHostViewGtkWidget; 156 friend class RenderWidgetHostViewGtkWidget;
176 157
177 CHROMEGTK_CALLBACK_1(RenderWidgetHostViewGtk, 158 CHROMEGTK_CALLBACK_1(RenderWidgetHostViewGtk,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // monitor (if the widget is aligned with that edge). Negative values 280 // monitor (if the widget is aligned with that edge). Negative values
300 // indicate the top edge, positive the bottom. 281 // indicate the top edge, positive the bottom.
301 int dragged_at_vertical_edge_; 282 int dragged_at_vertical_edge_;
302 283
303 gfx::PluginWindowHandle compositing_surface_; 284 gfx::PluginWindowHandle compositing_surface_;
304 285
305 // The event for the last mouse down we handled. We need this for context 286 // The event for the last mouse down we handled. We need this for context
306 // menus and drags. 287 // menus and drags.
307 GdkEventButton* last_mouse_down_; 288 GdkEventButton* last_mouse_down_;
308 289
309 // Instance of accessibility information for the root of the AtkObject
310 // tree representation of the WebKit render tree.
311 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_;
312
313 ui::GtkSignalRegistrar signals_; 290 ui::GtkSignalRegistrar signals_;
314 }; 291 };
315 292
316 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ 293 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698