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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "content/browser/frame_host/frame_tree.h" 18 #include "content/browser/frame_host/frame_tree.h"
19 #include "content/browser/frame_host/navigation_controller_delegate.h" 19 #include "content/browser/frame_host/navigation_controller_delegate.h"
20 #include "content/browser/frame_host/navigation_controller_impl.h" 20 #include "content/browser/frame_host/navigation_controller_impl.h"
21 #include "content/browser/frame_host/navigator_delegate.h" 21 #include "content/browser/frame_host/navigator_delegate.h"
22 #include "content/browser/frame_host/render_frame_host_delegate.h" 22 #include "content/browser/frame_host/render_frame_host_delegate.h"
23 #include "content/browser/frame_host/render_frame_host_manager.h" 23 #include "content/browser/frame_host/render_frame_host_manager.h"
24 #include "content/browser/renderer_host/render_view_host_delegate.h" 24 #include "content/browser/renderer_host/render_view_host_delegate.h"
25 #include "content/browser/renderer_host/render_widget_host_delegate.h" 25 #include "content/browser/renderer_host/render_widget_host_delegate.h"
26 #include "content/common/accessibility_mode_enums.h"
26 #include "content/common/content_export.h" 27 #include "content/common/content_export.h"
27 #include "content/public/browser/color_chooser.h" 28 #include "content/public/browser/color_chooser.h"
28 #include "content/public/browser/notification_observer.h" 29 #include "content/public/browser/notification_observer.h"
29 #include "content/public/browser/notification_registrar.h" 30 #include "content/public/browser/notification_registrar.h"
30 #include "content/public/browser/web_contents.h" 31 #include "content/public/browser/web_contents.h"
31 #include "content/public/common/page_transition_types.h" 32 #include "content/public/common/page_transition_types.h"
32 #include "content/public/common/renderer_preferences.h" 33 #include "content/public/common/renderer_preferences.h"
33 #include "content/public/common/resource_type.h" 34 #include "content/public/common/resource_type.h"
34 #include "content/public/common/three_d_api_types.h" 35 #include "content/public/common/three_d_api_types.h"
35 #include "net/base/load_states.h" 36 #include "net/base/load_states.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 public NotificationObserver, 89 public NotificationObserver,
89 public NON_EXPORTED_BASE(NavigationControllerDelegate), 90 public NON_EXPORTED_BASE(NavigationControllerDelegate),
90 public NON_EXPORTED_BASE(NavigatorDelegate) { 91 public NON_EXPORTED_BASE(NavigatorDelegate) {
91 public: 92 public:
92 virtual ~WebContentsImpl(); 93 virtual ~WebContentsImpl();
93 94
94 static WebContentsImpl* CreateWithOpener( 95 static WebContentsImpl* CreateWithOpener(
95 const WebContents::CreateParams& params, 96 const WebContents::CreateParams& params,
96 WebContentsImpl* opener); 97 WebContentsImpl* opener);
97 98
99 static std::vector<WebContentsImpl*> GetAllWebContents();
100
98 // Returns the opener WebContentsImpl, if any. This can be set to null if the 101 // Returns the opener WebContentsImpl, if any. This can be set to null if the
99 // opener is closed or the page clears its window.opener. 102 // opener is closed or the page clears its window.opener.
100 WebContentsImpl* opener() const { return opener_; } 103 WebContentsImpl* opener() const { return opener_; }
101 104
102 // Creates a swapped out RenderView. This is used by the browser plugin to 105 // Creates a swapped out RenderView. This is used by the browser plugin to
103 // create a swapped out RenderView in the embedder render process for the 106 // create a swapped out RenderView in the embedder render process for the
104 // guest, to expose the guest's window object to the embedder. 107 // guest, to expose the guest's window object to the embedder.
105 // This returns the routing ID of the newly created swapped out RenderView. 108 // This returns the routing ID of the newly created swapped out RenderView.
106 int CreateSwappedOutRenderView(SiteInstance* instance); 109 int CreateSwappedOutRenderView(SiteInstance* instance);
107 110
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 GeolocationDispatcherHost* geolocation_dispatcher_host() { 167 GeolocationDispatcherHost* geolocation_dispatcher_host() {
165 return geolocation_dispatcher_host_.get(); 168 return geolocation_dispatcher_host_.get();
166 } 169 }
167 170
168 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host() { 171 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host() {
169 return screen_orientation_dispatcher_host_.get(); 172 return screen_orientation_dispatcher_host_.get();
170 } 173 }
171 174
172 bool should_normally_be_visible() { return should_normally_be_visible_; } 175 bool should_normally_be_visible() { return should_normally_be_visible_; }
173 176
177 // Broadcasts the mode change to all frames.
178 void SetAccessibilityMode(AccessibilityMode mode);
179
180 // Adds the given accessibility mode to the current accessibility mode
181 // bitmap.
182 void AddAccessibilityMode(AccessibilityMode mode);
183
184 // Removes the given accessibility mode from the current accessibility
185 // mode bitmap, managing the bits that are shared with other modes such
186 // that a bit will only be turned off when all modes that depend on it
187 // have been removed.
188 void RemoveAccessibilityMode(AccessibilityMode mode);
189
190 AccessibilityMode accessibility_mode() const { return accessibility_mode_; }
191
174 // WebContents ------------------------------------------------------ 192 // WebContents ------------------------------------------------------
175 virtual WebContentsDelegate* GetDelegate() OVERRIDE; 193 virtual WebContentsDelegate* GetDelegate() OVERRIDE;
176 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE; 194 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE;
177 virtual NavigationControllerImpl& GetController() OVERRIDE; 195 virtual NavigationControllerImpl& GetController() OVERRIDE;
178 virtual const NavigationControllerImpl& GetController() const OVERRIDE; 196 virtual const NavigationControllerImpl& GetController() const OVERRIDE;
179 virtual BrowserContext* GetBrowserContext() const OVERRIDE; 197 virtual BrowserContext* GetBrowserContext() const OVERRIDE;
180 virtual const GURL& GetURL() const OVERRIDE; 198 virtual const GURL& GetURL() const OVERRIDE;
181 virtual const GURL& GetVisibleURL() const OVERRIDE; 199 virtual const GURL& GetVisibleURL() const OVERRIDE;
182 virtual const GURL& GetLastCommittedURL() const OVERRIDE; 200 virtual const GURL& GetLastCommittedURL() const OVERRIDE;
183 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE; 201 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE;
184 virtual RenderFrameHost* GetMainFrame() OVERRIDE; 202 virtual RenderFrameHost* GetMainFrame() OVERRIDE;
185 virtual RenderFrameHost* GetFocusedFrame() OVERRIDE; 203 virtual RenderFrameHost* GetFocusedFrame() OVERRIDE;
186 virtual void ForEachFrame( 204 virtual void ForEachFrame(
187 const base::Callback<void(RenderFrameHost*)>& on_frame) OVERRIDE; 205 const base::Callback<void(RenderFrameHost*)>& on_frame) OVERRIDE;
188 virtual void SendToAllFrames(IPC::Message* message) OVERRIDE; 206 virtual void SendToAllFrames(IPC::Message* message) OVERRIDE;
189 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE; 207 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE;
190 virtual int GetRoutingID() const OVERRIDE; 208 virtual int GetRoutingID() const OVERRIDE;
191 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE; 209 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE;
192 virtual RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const 210 virtual RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const
193 OVERRIDE; 211 OVERRIDE;
194 virtual WebUI* CreateWebUI(const GURL& url) OVERRIDE; 212 virtual WebUI* CreateWebUI(const GURL& url) OVERRIDE;
195 virtual WebUI* GetWebUI() const OVERRIDE; 213 virtual WebUI* GetWebUI() const OVERRIDE;
196 virtual WebUI* GetCommittedWebUI() const OVERRIDE; 214 virtual WebUI* GetCommittedWebUI() const OVERRIDE;
197 virtual void SetUserAgentOverride(const std::string& override) OVERRIDE; 215 virtual void SetUserAgentOverride(const std::string& override) OVERRIDE;
198 virtual const std::string& GetUserAgentOverride() const OVERRIDE; 216 virtual const std::string& GetUserAgentOverride() const OVERRIDE;
217 virtual void EnableTreeOnlyAccessibilityMode() OVERRIDE;
218 virtual bool IsTreeOnlyAccessibilityModeForTesting() const OVERRIDE;
219 virtual bool IsFullAccessibilityModeForTesting() const OVERRIDE;
199 #if defined(OS_WIN) 220 #if defined(OS_WIN)
200 virtual void SetParentNativeViewAccessible( 221 virtual void SetParentNativeViewAccessible(
201 gfx::NativeViewAccessible accessible_parent) OVERRIDE; 222 gfx::NativeViewAccessible accessible_parent) OVERRIDE;
202 #endif 223 #endif
203 virtual const base::string16& GetTitle() const OVERRIDE; 224 virtual const base::string16& GetTitle() const OVERRIDE;
204 virtual int32 GetMaxPageID() OVERRIDE; 225 virtual int32 GetMaxPageID() OVERRIDE;
205 virtual int32 GetMaxPageIDForSiteInstance( 226 virtual int32 GetMaxPageIDForSiteInstance(
206 SiteInstance* site_instance) OVERRIDE; 227 SiteInstance* site_instance) OVERRIDE;
207 virtual SiteInstance* GetSiteInstance() const OVERRIDE; 228 virtual SiteInstance* GetSiteInstance() const OVERRIDE;
208 virtual SiteInstance* GetPendingSiteInstance() const OVERRIDE; 229 virtual SiteInstance* GetPendingSiteInstance() const OVERRIDE;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 virtual void DocumentOnLoadCompleted( 370 virtual void DocumentOnLoadCompleted(
350 RenderFrameHost* render_frame_host) OVERRIDE; 371 RenderFrameHost* render_frame_host) OVERRIDE;
351 virtual void UpdateTitle(RenderFrameHost* render_frame_host, 372 virtual void UpdateTitle(RenderFrameHost* render_frame_host,
352 int32 page_id, 373 int32 page_id,
353 const base::string16& title, 374 const base::string16& title,
354 base::i18n::TextDirection title_direction) OVERRIDE; 375 base::i18n::TextDirection title_direction) OVERRIDE;
355 virtual void UpdateEncoding(RenderFrameHost* render_frame_host, 376 virtual void UpdateEncoding(RenderFrameHost* render_frame_host,
356 const std::string& encoding) OVERRIDE; 377 const std::string& encoding) OVERRIDE;
357 virtual WebContents* GetAsWebContents() OVERRIDE; 378 virtual WebContents* GetAsWebContents() OVERRIDE;
358 virtual bool IsNeverVisible() OVERRIDE; 379 virtual bool IsNeverVisible() OVERRIDE;
380 virtual AccessibilityMode GetAccessibilityMode() const OVERRIDE;
David Tseng 2014/07/14 19:46:23 dups accessibility_mode() above?
ncarter (slow) 2014/07/15 01:23:28 It's a sort-of dup (one's virtual the other isn't)
dmazzoni 2014/07/15 07:55:04 We don't need both. I got rid of the non-virtual o
381 virtual void AccessibilityEventReceived(
382 const std::vector<AXEventNotificationDetails>& details) OVERRIDE;
383 #if defined(OS_WIN)
384 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE;
385 #endif
359 386
360 // RenderViewHostDelegate ---------------------------------------------------- 387 // RenderViewHostDelegate ----------------------------------------------------
361 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; 388 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE;
362 virtual bool OnMessageReceived(RenderViewHost* render_view_host, 389 virtual bool OnMessageReceived(RenderViewHost* render_view_host,
363 const IPC::Message& message) OVERRIDE; 390 const IPC::Message& message) OVERRIDE;
364 // RenderFrameHostDelegate has the same method, so list it there because this 391 // RenderFrameHostDelegate has the same method, so list it there because this
365 // interface is going away. 392 // interface is going away.
366 // virtual WebContents* GetAsWebContents() OVERRIDE; 393 // virtual WebContents* GetAsWebContents() OVERRIDE;
367 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; 394 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
368 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; 395 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 virtual void ShowCreatedWidget(int route_id, 464 virtual void ShowCreatedWidget(int route_id,
438 const gfx::Rect& initial_pos) OVERRIDE; 465 const gfx::Rect& initial_pos) OVERRIDE;
439 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; 466 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE;
440 virtual void RequestMediaAccessPermission( 467 virtual void RequestMediaAccessPermission(
441 const MediaStreamRequest& request, 468 const MediaStreamRequest& request,
442 const MediaResponseCallback& callback) OVERRIDE; 469 const MediaResponseCallback& callback) OVERRIDE;
443 virtual SessionStorageNamespace* GetSessionStorageNamespace( 470 virtual SessionStorageNamespace* GetSessionStorageNamespace(
444 SiteInstance* instance) OVERRIDE; 471 SiteInstance* instance) OVERRIDE;
445 virtual SessionStorageNamespaceMap GetSessionStorageNamespaceMap() OVERRIDE; 472 virtual SessionStorageNamespaceMap GetSessionStorageNamespaceMap() OVERRIDE;
446 virtual FrameTree* GetFrameTree() OVERRIDE; 473 virtual FrameTree* GetFrameTree() OVERRIDE;
447 virtual void AccessibilityEventReceived(
448 const std::vector<AXEventNotificationDetails>& details) OVERRIDE;
449 474
450 // NavigatorDelegate --------------------------------------------------------- 475 // NavigatorDelegate ---------------------------------------------------------
451 476
452 virtual void DidStartProvisionalLoad( 477 virtual void DidStartProvisionalLoad(
453 RenderFrameHostImpl* render_frame_host, 478 RenderFrameHostImpl* render_frame_host,
454 const GURL& validated_url, 479 const GURL& validated_url,
455 bool is_error_page, 480 bool is_error_page,
456 bool is_iframe_srcdoc) OVERRIDE; 481 bool is_iframe_srcdoc) OVERRIDE;
457 virtual void DidFailProvisionalLoadWithError( 482 virtual void DidFailProvisionalLoadWithError(
458 RenderFrameHostImpl* render_frame_host, 483 RenderFrameHostImpl* render_frame_host,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 virtual void HandleKeyboardEvent( 528 virtual void HandleKeyboardEvent(
504 const NativeWebKeyboardEvent& event) OVERRIDE; 529 const NativeWebKeyboardEvent& event) OVERRIDE;
505 virtual bool HandleWheelEvent( 530 virtual bool HandleWheelEvent(
506 const blink::WebMouseWheelEvent& event) OVERRIDE; 531 const blink::WebMouseWheelEvent& event) OVERRIDE;
507 virtual bool PreHandleGestureEvent( 532 virtual bool PreHandleGestureEvent(
508 const blink::WebGestureEvent& event) OVERRIDE; 533 const blink::WebGestureEvent& event) OVERRIDE;
509 virtual bool HandleGestureEvent( 534 virtual bool HandleGestureEvent(
510 const blink::WebGestureEvent& event) OVERRIDE; 535 const blink::WebGestureEvent& event) OVERRIDE;
511 virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) OVERRIDE; 536 virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) OVERRIDE;
512 virtual void OnTouchEmulationEnabled(bool enabled) OVERRIDE; 537 virtual void OnTouchEmulationEnabled(bool enabled) OVERRIDE;
513 #if defined(OS_WIN) 538 virtual BrowserAccessibilityManager* GetRootBrowserAccessibilityManager()
514 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE; 539 OVERRIDE;
515 #endif 540 virtual BrowserAccessibilityManager*
541 GetOrCreateRootBrowserAccessibilityManager() OVERRIDE;
516 542
517 // RenderFrameHostManager::Delegate ------------------------------------------ 543 // RenderFrameHostManager::Delegate ------------------------------------------
518 544
519 virtual bool CreateRenderViewForRenderManager( 545 virtual bool CreateRenderViewForRenderManager(
520 RenderViewHost* render_view_host, 546 RenderViewHost* render_view_host,
521 int opener_route_id, 547 int opener_route_id,
522 int proxy_routing_id, 548 int proxy_routing_id,
523 bool for_main_frame) OVERRIDE; 549 bool for_main_frame) OVERRIDE;
524 virtual void BeforeUnloadFiredFromRenderManager( 550 virtual void BeforeUnloadFiredFromRenderManager(
525 bool proceed, const base::TimeTicks& proceed_time, 551 bool proceed, const base::TimeTicks& proceed_time,
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 // Whether the last JavaScript dialog shown was suppressed. Used for testing. 1170 // Whether the last JavaScript dialog shown was suppressed. Used for testing.
1145 bool last_dialog_suppressed_; 1171 bool last_dialog_suppressed_;
1146 1172
1147 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_; 1173 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_;
1148 1174
1149 scoped_ptr<MidiDispatcherHost> midi_dispatcher_host_; 1175 scoped_ptr<MidiDispatcherHost> midi_dispatcher_host_;
1150 1176
1151 scoped_ptr<ScreenOrientationDispatcherHost> 1177 scoped_ptr<ScreenOrientationDispatcherHost>
1152 screen_orientation_dispatcher_host_; 1178 screen_orientation_dispatcher_host_;
1153 1179
1180 // The accessibility mode for all frames. This is queried when each frame
1181 // is created, and broadcast to all frames when it changes.
1182 AccessibilityMode accessibility_mode_;
1183
1154 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1184 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1155 }; 1185 };
1156 1186
1157 } // namespace content 1187 } // namespace content
1158 1188
1159 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1189 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698