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

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: Get rid of ForEachFrameAndPendingFrame Created 6 years, 6 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/three_d_api_types.h" 34 #include "content/public/common/three_d_api_types.h"
34 #include "net/base/load_states.h" 35 #include "net/base/load_states.h"
35 #include "third_party/WebKit/public/web/WebDragOperation.h" 36 #include "third_party/WebKit/public/web/WebDragOperation.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 public NotificationObserver, 88 public NotificationObserver,
88 public NON_EXPORTED_BASE(NavigationControllerDelegate), 89 public NON_EXPORTED_BASE(NavigationControllerDelegate),
89 public NON_EXPORTED_BASE(NavigatorDelegate) { 90 public NON_EXPORTED_BASE(NavigatorDelegate) {
90 public: 91 public:
91 virtual ~WebContentsImpl(); 92 virtual ~WebContentsImpl();
92 93
93 static WebContentsImpl* CreateWithOpener( 94 static WebContentsImpl* CreateWithOpener(
94 const WebContents::CreateParams& params, 95 const WebContents::CreateParams& params,
95 WebContentsImpl* opener); 96 WebContentsImpl* opener);
96 97
98 static std::vector<WebContentsImpl*> GetAllWebContents();
99
97 // Returns the opener WebContentsImpl, if any. This can be set to null if the 100 // Returns the opener WebContentsImpl, if any. This can be set to null if the
98 // opener is closed or the page clears its window.opener. 101 // opener is closed or the page clears its window.opener.
99 WebContentsImpl* opener() const { return opener_; } 102 WebContentsImpl* opener() const { return opener_; }
100 103
101 // Creates a swapped out RenderView. This is used by the browser plugin to 104 // Creates a swapped out RenderView. This is used by the browser plugin to
102 // create a swapped out RenderView in the embedder render process for the 105 // create a swapped out RenderView in the embedder render process for the
103 // guest, to expose the guest's window object to the embedder. 106 // guest, to expose the guest's window object to the embedder.
104 // This returns the routing ID of the newly created swapped out RenderView. 107 // This returns the routing ID of the newly created swapped out RenderView.
105 int CreateSwappedOutRenderView(SiteInstance* instance); 108 int CreateSwappedOutRenderView(SiteInstance* instance);
106 109
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const ResourceRedirectDetails& details); 162 const ResourceRedirectDetails& details);
160 163
161 WebContentsView* GetView() const; 164 WebContentsView* GetView() const;
162 165
163 GeolocationDispatcherHost* geolocation_dispatcher_host() { 166 GeolocationDispatcherHost* geolocation_dispatcher_host() {
164 return geolocation_dispatcher_host_.get(); 167 return geolocation_dispatcher_host_.get();
165 } 168 }
166 169
167 bool should_normally_be_visible() { return should_normally_be_visible_; } 170 bool should_normally_be_visible() { return should_normally_be_visible_; }
168 171
172 // Broadcasts the mode change to all frames.
173 void SetAccessibilityMode(AccessibilityMode mode);
174
175 // Adds the given accessibility mode to the current accessibility mode
176 // bitmap.
177 void AddAccessibilityMode(AccessibilityMode mode);
178
179 // Removes the given accessibility mode from the current accessibility
180 // mode bitmap, managing the bits that are shared with other modes such
181 // that a bit will only be turned off when all modes that depend on it
182 // have been removed.
183 void RemoveAccessibilityMode(AccessibilityMode mode);
184
185 AccessibilityMode accessibility_mode() const { return accessibility_mode_; }
186
169 // WebContents ------------------------------------------------------ 187 // WebContents ------------------------------------------------------
170 virtual WebContentsDelegate* GetDelegate() OVERRIDE; 188 virtual WebContentsDelegate* GetDelegate() OVERRIDE;
171 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE; 189 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE;
172 virtual NavigationControllerImpl& GetController() OVERRIDE; 190 virtual NavigationControllerImpl& GetController() OVERRIDE;
173 virtual const NavigationControllerImpl& GetController() const OVERRIDE; 191 virtual const NavigationControllerImpl& GetController() const OVERRIDE;
174 virtual BrowserContext* GetBrowserContext() const OVERRIDE; 192 virtual BrowserContext* GetBrowserContext() const OVERRIDE;
175 virtual const GURL& GetURL() const OVERRIDE; 193 virtual const GURL& GetURL() const OVERRIDE;
176 virtual const GURL& GetVisibleURL() const OVERRIDE; 194 virtual const GURL& GetVisibleURL() const OVERRIDE;
177 virtual const GURL& GetLastCommittedURL() const OVERRIDE; 195 virtual const GURL& GetLastCommittedURL() const OVERRIDE;
178 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE; 196 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE;
179 virtual RenderFrameHost* GetMainFrame() OVERRIDE; 197 virtual RenderFrameHost* GetMainFrame() OVERRIDE;
180 virtual RenderFrameHost* GetFocusedFrame() OVERRIDE; 198 virtual RenderFrameHost* GetFocusedFrame() OVERRIDE;
181 virtual void ForEachFrame( 199 virtual void ForEachFrame(
182 const base::Callback<void(RenderFrameHost*)>& on_frame) OVERRIDE; 200 const base::Callback<void(RenderFrameHost*)>& on_frame) OVERRIDE;
183 virtual void SendToAllFrames(IPC::Message* message) OVERRIDE; 201 virtual void SendToAllFrames(IPC::Message* message) OVERRIDE;
184 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE; 202 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE;
185 virtual int GetRoutingID() const OVERRIDE; 203 virtual int GetRoutingID() const OVERRIDE;
186 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE; 204 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE;
187 virtual RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const 205 virtual RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const
188 OVERRIDE; 206 OVERRIDE;
189 virtual WebUI* CreateWebUI(const GURL& url) OVERRIDE; 207 virtual WebUI* CreateWebUI(const GURL& url) OVERRIDE;
190 virtual WebUI* GetWebUI() const OVERRIDE; 208 virtual WebUI* GetWebUI() const OVERRIDE;
191 virtual WebUI* GetCommittedWebUI() const OVERRIDE; 209 virtual WebUI* GetCommittedWebUI() const OVERRIDE;
192 virtual void SetUserAgentOverride(const std::string& override) OVERRIDE; 210 virtual void SetUserAgentOverride(const std::string& override) OVERRIDE;
193 virtual const std::string& GetUserAgentOverride() const OVERRIDE; 211 virtual const std::string& GetUserAgentOverride() const OVERRIDE;
212 virtual void EnableTreeOnlyAccessibilityMode() OVERRIDE;
213 virtual bool IsTreeOnlyAccessibilityModeForTesting() const OVERRIDE;
214 virtual bool IsFullAccessibilityModeForTesting() const OVERRIDE;
194 #if defined(OS_WIN) 215 #if defined(OS_WIN)
195 virtual void SetParentNativeViewAccessible( 216 virtual void SetParentNativeViewAccessible(
196 gfx::NativeViewAccessible accessible_parent) OVERRIDE; 217 gfx::NativeViewAccessible accessible_parent) OVERRIDE;
197 #endif 218 #endif
198 virtual const base::string16& GetTitle() const OVERRIDE; 219 virtual const base::string16& GetTitle() const OVERRIDE;
199 virtual int32 GetMaxPageID() OVERRIDE; 220 virtual int32 GetMaxPageID() OVERRIDE;
200 virtual int32 GetMaxPageIDForSiteInstance( 221 virtual int32 GetMaxPageIDForSiteInstance(
201 SiteInstance* site_instance) OVERRIDE; 222 SiteInstance* site_instance) OVERRIDE;
202 virtual SiteInstance* GetSiteInstance() const OVERRIDE; 223 virtual SiteInstance* GetSiteInstance() const OVERRIDE;
203 virtual SiteInstance* GetPendingSiteInstance() const OVERRIDE; 224 virtual SiteInstance* GetPendingSiteInstance() const OVERRIDE;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 virtual void DocumentOnLoadCompleted( 369 virtual void DocumentOnLoadCompleted(
349 RenderFrameHost* render_frame_host) OVERRIDE; 370 RenderFrameHost* render_frame_host) OVERRIDE;
350 virtual void UpdateTitle(RenderFrameHost* render_frame_host, 371 virtual void UpdateTitle(RenderFrameHost* render_frame_host,
351 int32 page_id, 372 int32 page_id,
352 const base::string16& title, 373 const base::string16& title,
353 base::i18n::TextDirection title_direction) OVERRIDE; 374 base::i18n::TextDirection title_direction) OVERRIDE;
354 virtual void UpdateEncoding(RenderFrameHost* render_frame_host, 375 virtual void UpdateEncoding(RenderFrameHost* render_frame_host,
355 const std::string& encoding) OVERRIDE; 376 const std::string& encoding) OVERRIDE;
356 virtual WebContents* GetAsWebContents() OVERRIDE; 377 virtual WebContents* GetAsWebContents() OVERRIDE;
357 virtual bool IsNeverVisible() OVERRIDE; 378 virtual bool IsNeverVisible() OVERRIDE;
379 virtual AccessibilityMode GetAccessibilityMode() const OVERRIDE;
380 virtual void AccessibilityEventReceived(
381 const std::vector<AXEventNotificationDetails>& details) OVERRIDE;
382 #if defined(OS_WIN)
383 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE;
384 #endif
358 385
359 // RenderViewHostDelegate ---------------------------------------------------- 386 // RenderViewHostDelegate ----------------------------------------------------
360 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; 387 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE;
361 virtual bool OnMessageReceived(RenderViewHost* render_view_host, 388 virtual bool OnMessageReceived(RenderViewHost* render_view_host,
362 const IPC::Message& message) OVERRIDE; 389 const IPC::Message& message) OVERRIDE;
363 // RenderFrameHostDelegate has the same method, so list it there because this 390 // RenderFrameHostDelegate has the same method, so list it there because this
364 // interface is going away. 391 // interface is going away.
365 // virtual WebContents* GetAsWebContents() OVERRIDE; 392 // virtual WebContents* GetAsWebContents() OVERRIDE;
366 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; 393 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
367 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; 394 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 bool user_gesture) OVERRIDE; 462 bool user_gesture) OVERRIDE;
436 virtual void ShowCreatedWidget(int route_id, 463 virtual void ShowCreatedWidget(int route_id,
437 const gfx::Rect& initial_pos) OVERRIDE; 464 const gfx::Rect& initial_pos) OVERRIDE;
438 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; 465 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE;
439 virtual void RequestMediaAccessPermission( 466 virtual void RequestMediaAccessPermission(
440 const MediaStreamRequest& request, 467 const MediaStreamRequest& request,
441 const MediaResponseCallback& callback) OVERRIDE; 468 const MediaResponseCallback& callback) OVERRIDE;
442 virtual SessionStorageNamespace* GetSessionStorageNamespace( 469 virtual SessionStorageNamespace* GetSessionStorageNamespace(
443 SiteInstance* instance) OVERRIDE; 470 SiteInstance* instance) OVERRIDE;
444 virtual FrameTree* GetFrameTree() OVERRIDE; 471 virtual FrameTree* GetFrameTree() OVERRIDE;
445 virtual void AccessibilityEventReceived(
446 const std::vector<AXEventNotificationDetails>& details) OVERRIDE;
447 472
448 // NavigatorDelegate --------------------------------------------------------- 473 // NavigatorDelegate ---------------------------------------------------------
449 474
450 virtual void DidStartProvisionalLoad( 475 virtual void DidStartProvisionalLoad(
451 RenderFrameHostImpl* render_frame_host, 476 RenderFrameHostImpl* render_frame_host,
452 int parent_routing_id, 477 int parent_routing_id,
453 const GURL& validated_url, 478 const GURL& validated_url,
454 bool is_error_page, 479 bool is_error_page,
455 bool is_iframe_srcdoc) OVERRIDE; 480 bool is_iframe_srcdoc) OVERRIDE;
456 virtual void DidFailProvisionalLoadWithError( 481 virtual void DidFailProvisionalLoadWithError(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 bool* is_keyboard_shortcut) OVERRIDE; 528 bool* is_keyboard_shortcut) OVERRIDE;
504 virtual void HandleKeyboardEvent( 529 virtual void HandleKeyboardEvent(
505 const NativeWebKeyboardEvent& event) OVERRIDE; 530 const NativeWebKeyboardEvent& event) OVERRIDE;
506 virtual bool HandleWheelEvent( 531 virtual bool HandleWheelEvent(
507 const blink::WebMouseWheelEvent& event) OVERRIDE; 532 const blink::WebMouseWheelEvent& event) OVERRIDE;
508 virtual bool PreHandleGestureEvent( 533 virtual bool PreHandleGestureEvent(
509 const blink::WebGestureEvent& event) OVERRIDE; 534 const blink::WebGestureEvent& event) OVERRIDE;
510 virtual bool HandleGestureEvent( 535 virtual bool HandleGestureEvent(
511 const blink::WebGestureEvent& event) OVERRIDE; 536 const blink::WebGestureEvent& event) OVERRIDE;
512 virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) OVERRIDE; 537 virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) OVERRIDE;
513 #if defined(OS_WIN) 538 virtual BrowserAccessibilityManager* GetRootBrowserAccessibilityManager()
514 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE; 539 OVERRIDE;
jam 2014/05/28 23:17:41 nit: don't start a line with OVERRIDE (if clang fo
515 #endif
516 540
517 // RenderFrameHostManager::Delegate ------------------------------------------ 541 // RenderFrameHostManager::Delegate ------------------------------------------
518 542
519 virtual bool CreateRenderViewForRenderManager( 543 virtual bool CreateRenderViewForRenderManager(
520 RenderViewHost* render_view_host, 544 RenderViewHost* render_view_host,
521 int opener_route_id, 545 int opener_route_id,
522 int proxy_routing_id, 546 int proxy_routing_id,
523 bool for_main_frame) OVERRIDE; 547 bool for_main_frame) OVERRIDE;
524 virtual void BeforeUnloadFiredFromRenderManager( 548 virtual void BeforeUnloadFiredFromRenderManager(
525 bool proceed, const base::TimeTicks& proceed_time, 549 bool proceed, const base::TimeTicks& proceed_time,
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 1148
1125 // Whether this WebContents is responsible for displaying a subframe in a 1149 // Whether this WebContents is responsible for displaying a subframe in a
1126 // different process from its parent page. 1150 // different process from its parent page.
1127 bool is_subframe_; 1151 bool is_subframe_;
1128 1152
1129 // Whether the last JavaScript dialog shown was suppressed. Used for testing. 1153 // Whether the last JavaScript dialog shown was suppressed. Used for testing.
1130 bool last_dialog_suppressed_; 1154 bool last_dialog_suppressed_;
1131 1155
1132 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_; 1156 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_;
1133 1157
1158 // The accessibility mode for all frames. This is queried when each frame
1159 // is created, and broadcast to all frames when it changes.
1160 AccessibilityMode accessibility_mode_;
1161
1134 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1162 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1135 }; 1163 };
1136 1164
1137 } // namespace content 1165 } // namespace content
1138 1166
1139 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1167 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698