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

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

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win & android compile Created 6 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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/metrics/stats_counters.h" 14 #include "base/metrics/stats_counters.h"
15 #include "base/process/process.h" 15 #include "base/process/process.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "content/browser/accessibility/accessibility_mode_helper.h"
22 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
21 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 23 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
22 #include "content/browser/browser_plugin/browser_plugin_guest.h" 24 #include "content/browser/browser_plugin/browser_plugin_guest.h"
23 #include "content/browser/child_process_security_policy_impl.h" 25 #include "content/browser/child_process_security_policy_impl.h"
24 #include "content/browser/devtools/render_view_devtools_agent_host.h" 26 #include "content/browser/devtools/render_view_devtools_agent_host.h"
25 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 27 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
26 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 28 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
27 #include "content/browser/download/download_stats.h" 29 #include "content/browser/download/download_stats.h"
28 #include "content/browser/download/mhtml_generation_manager.h" 30 #include "content/browser/download/mhtml_generation_manager.h"
29 #include "content/browser/download/save_package.h" 31 #include "content/browser/download/save_package.h"
30 #include "content/browser/frame_host/cross_process_frame_connector.h" 32 #include "content/browser/frame_host/cross_process_frame_connector.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "content/public/browser/devtools_agent_host.h" 65 #include "content/public/browser/devtools_agent_host.h"
64 #include "content/public/browser/download_manager.h" 66 #include "content/public/browser/download_manager.h"
65 #include "content/public/browser/download_url_parameters.h" 67 #include "content/public/browser/download_url_parameters.h"
66 #include "content/public/browser/invalidate_type.h" 68 #include "content/public/browser/invalidate_type.h"
67 #include "content/public/browser/javascript_dialog_manager.h" 69 #include "content/public/browser/javascript_dialog_manager.h"
68 #include "content/public/browser/load_from_memory_cache_details.h" 70 #include "content/public/browser/load_from_memory_cache_details.h"
69 #include "content/public/browser/load_notification_details.h" 71 #include "content/public/browser/load_notification_details.h"
70 #include "content/public/browser/navigation_details.h" 72 #include "content/public/browser/navigation_details.h"
71 #include "content/public/browser/notification_details.h" 73 #include "content/public/browser/notification_details.h"
72 #include "content/public/browser/notification_service.h" 74 #include "content/public/browser/notification_service.h"
75 #include "content/public/browser/render_widget_host_iterator.h"
73 #include "content/public/browser/resource_request_details.h" 76 #include "content/public/browser/resource_request_details.h"
74 #include "content/public/browser/storage_partition.h" 77 #include "content/public/browser/storage_partition.h"
75 #include "content/public/browser/user_metrics.h" 78 #include "content/public/browser/user_metrics.h"
76 #include "content/public/browser/web_contents_delegate.h" 79 #include "content/public/browser/web_contents_delegate.h"
77 #include "content/public/browser/web_contents_observer.h" 80 #include "content/public/browser/web_contents_observer.h"
78 #include "content/public/common/bindings_policy.h" 81 #include "content/public/common/bindings_policy.h"
79 #include "content/public/common/content_constants.h" 82 #include "content/public/common/content_constants.h"
80 #include "content/public/common/content_switches.h" 83 #include "content/public/common/content_switches.h"
81 #include "content/public/common/page_zoom.h" 84 #include "content/public/common/page_zoom.h"
82 #include "content/public/common/result_codes.h" 85 #include "content/public/common/result_codes.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 225 }
223 226
224 void RunRenderFrameDeleted( 227 void RunRenderFrameDeleted(
225 ObserverList<WebContentsObserver>* observer_list, 228 ObserverList<WebContentsObserver>* observer_list,
226 RenderFrameHost* render_frame_host) { 229 RenderFrameHost* render_frame_host) {
227 FOR_EACH_OBSERVER(WebContentsObserver, 230 FOR_EACH_OBSERVER(WebContentsObserver,
228 *observer_list, 231 *observer_list,
229 RenderFrameDeleted(render_frame_host)); 232 RenderFrameDeleted(render_frame_host));
230 } 233 }
231 234
235 void SetAccessibilityModeOnFrame(AccessibilityMode mode,
236 RenderFrameHost* frame_host) {
237 static_cast<RenderFrameHostImpl*>(frame_host)->SetAccessibilityMode(mode);
238 }
239
232 } // namespace 240 } // namespace
233 241
234 WebContents* WebContents::Create(const WebContents::CreateParams& params) { 242 WebContents* WebContents::Create(const WebContents::CreateParams& params) {
235 return WebContentsImpl::CreateWithOpener( 243 return WebContentsImpl::CreateWithOpener(
236 params, static_cast<WebContentsImpl*>(params.opener)); 244 params, static_cast<WebContentsImpl*>(params.opener));
237 } 245 }
238 246
239 WebContents* WebContents::CreateWithSessionStorage( 247 WebContents* WebContents::CreateWithSessionStorage(
240 const WebContents::CreateParams& params, 248 const WebContents::CreateParams& params,
241 const SessionStorageNamespaceMap& session_storage_namespace_map) { 249 const SessionStorageNamespaceMap& session_storage_namespace_map) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 last_active_time_(base::TimeTicks::Now()), 353 last_active_time_(base::TimeTicks::Now()),
346 closed_by_user_gesture_(false), 354 closed_by_user_gesture_(false),
347 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), 355 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
348 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), 356 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
349 temporary_zoom_settings_(false), 357 temporary_zoom_settings_(false),
350 totalPinchGestureAmount_(0), 358 totalPinchGestureAmount_(0),
351 currentPinchZoomStepDelta_(0), 359 currentPinchZoomStepDelta_(0),
352 render_view_message_source_(NULL), 360 render_view_message_source_(NULL),
353 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), 361 fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
354 is_subframe_(false), 362 is_subframe_(false),
355 last_dialog_suppressed_(false) { 363 last_dialog_suppressed_(false),
364 accessibility_mode_(
365 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()) {
356 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) 366 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
357 g_created_callbacks.Get().at(i).Run(this); 367 g_created_callbacks.Get().at(i).Run(this);
358 frame_tree_.SetFrameRemoveListener( 368 frame_tree_.SetFrameRemoveListener(
359 base::Bind(&WebContentsImpl::OnFrameRemoved, 369 base::Bind(&WebContentsImpl::OnFrameRemoved,
360 base::Unretained(this))); 370 base::Unretained(this)));
361 } 371 }
362 372
363 WebContentsImpl::~WebContentsImpl() { 373 WebContentsImpl::~WebContentsImpl() {
364 is_being_destroyed_ = true; 374 is_being_destroyed_ = true;
365 375
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 new_contents, 450 new_contents,
441 extra_params.Pass()); 451 extra_params.Pass());
442 // We are instantiating a WebContents for browser plugin. Set its subframe 452 // We are instantiating a WebContents for browser plugin. Set its subframe
443 // bit to true. 453 // bit to true.
444 new_contents->is_subframe_ = true; 454 new_contents->is_subframe_ = true;
445 } 455 }
446 new_contents->Init(params); 456 new_contents->Init(params);
447 return new_contents; 457 return new_contents;
448 } 458 }
449 459
460 // static
461 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() {
462 std::vector<WebContentsImpl*> result;
463 scoped_ptr<RenderWidgetHostIterator> widgets(
464 RenderWidgetHostImpl::GetRenderWidgetHosts());
465 std::set<WebContentsImpl*> web_contents_set;
466 while (RenderWidgetHost* rwh = widgets->GetNextHost()) {
467 if (!rwh->IsRenderView())
468 continue;
469 RenderViewHost* rvh = RenderViewHost::From(rwh);
470 if (!rvh)
471 continue;
472 WebContents* web_contents = WebContents::FromRenderViewHost(rvh);
473 if (!web_contents)
474 continue;
475 WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents);
476 if (web_contents_set.find(wci) == web_contents_set.end()) {
477 web_contents_set.insert(wci);
478 result.push_back(wci);
479 }
480 }
481 return result;
482 }
483
450 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() { 484 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() {
451 return GetRenderManager(); 485 return GetRenderManager();
452 } 486 }
453 487
454 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, 488 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
455 const IPC::Message& message) { 489 const IPC::Message& message) {
456 return OnMessageReceived(render_view_host, NULL, message); 490 return OnMessageReceived(render_view_host, NULL, message);
457 } 491 }
458 492
459 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, 493 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 if (!frame_tree_.GetFocusedFrame()) 656 if (!frame_tree_.GetFocusedFrame())
623 return NULL; 657 return NULL;
624 return frame_tree_.GetFocusedFrame()->current_frame_host(); 658 return frame_tree_.GetFocusedFrame()->current_frame_host();
625 } 659 }
626 660
627 void WebContentsImpl::ForEachFrame( 661 void WebContentsImpl::ForEachFrame(
628 const base::Callback<void(RenderFrameHost*)>& on_frame) { 662 const base::Callback<void(RenderFrameHost*)>& on_frame) {
629 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); 663 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame));
630 } 664 }
631 665
666 void WebContentsImpl::ForEachFrameAndPendingFrame(
667 const base::Callback<void(RenderFrameHost*)>& on_frame) {
668 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame));
669 frame_tree_.ForEach(base::Bind(&ForEachPendingFrameInternal, on_frame));
670 }
671
632 void WebContentsImpl::SendToAllFrames(IPC::Message* message) { 672 void WebContentsImpl::SendToAllFrames(IPC::Message* message) {
633 ForEachFrame(base::Bind(&SendToAllFramesInternal, message)); 673 ForEachFrame(base::Bind(&SendToAllFramesInternal, message));
634 delete message; 674 delete message;
635 } 675 }
636 676
637 RenderViewHost* WebContentsImpl::GetRenderViewHost() const { 677 RenderViewHost* WebContentsImpl::GetRenderViewHost() const {
638 return GetRenderManager()->current_host(); 678 return GetRenderManager()->current_host();
639 } 679 }
640 680
641 WebContents* WebContentsImpl::GetEmbedderWebContents() const { 681 WebContents* WebContentsImpl::GetEmbedderWebContents() const {
(...skipping 30 matching lines...) Expand all
672 RenderWidgetHost* const widget_host = 712 RenderWidgetHost* const widget_host =
673 RenderWidgetHostImpl::FromID(GetRenderProcessHost()->GetID(), 713 RenderWidgetHostImpl::FromID(GetRenderProcessHost()->GetID(),
674 GetFullscreenWidgetRoutingID()); 714 GetFullscreenWidgetRoutingID());
675 return widget_host ? widget_host->GetView() : NULL; 715 return widget_host ? widget_host->GetView() : NULL;
676 } 716 }
677 717
678 WebContentsView* WebContentsImpl::GetView() const { 718 WebContentsView* WebContentsImpl::GetView() const {
679 return view_.get(); 719 return view_.get();
680 } 720 }
681 721
722 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) {
723 if (mode == accessibility_mode_)
724 return;
725
726 accessibility_mode_ = mode;
727 ForEachFrameAndPendingFrame(base::Bind(&SetAccessibilityModeOnFrame, mode));
728 }
729
730 void WebContentsImpl::AddAccessibilityMode(AccessibilityMode mode) {
731 SetAccessibilityMode(
732 content::AddAccessibilityModeTo(accessibility_mode_, mode));
733 }
734
735 void WebContentsImpl::RemoveAccessibilityMode(AccessibilityMode mode) {
736 SetAccessibilityMode(
737 content::RemoveAccessibilityModeFrom(accessibility_mode_, mode));
738 }
739
682 WebUI* WebContentsImpl::CreateWebUI(const GURL& url) { 740 WebUI* WebContentsImpl::CreateWebUI(const GURL& url) {
683 WebUIImpl* web_ui = new WebUIImpl(this); 741 WebUIImpl* web_ui = new WebUIImpl(this);
684 WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> 742 WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()->
685 CreateWebUIControllerForURL(web_ui, url); 743 CreateWebUIControllerForURL(web_ui, url);
686 if (controller) { 744 if (controller) {
687 web_ui->AddMessageHandler(new GenericHandler()); 745 web_ui->AddMessageHandler(new GenericHandler());
688 web_ui->SetController(controller); 746 web_ui->SetController(controller);
689 return web_ui; 747 return web_ui;
690 } 748 }
691 749
(...skipping 28 matching lines...) Expand all
720 controller_.ReloadIgnoringCache(true); 778 controller_.ReloadIgnoringCache(true);
721 779
722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 780 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
723 UserAgentOverrideSet(override)); 781 UserAgentOverrideSet(override));
724 } 782 }
725 783
726 const std::string& WebContentsImpl::GetUserAgentOverride() const { 784 const std::string& WebContentsImpl::GetUserAgentOverride() const {
727 return renderer_preferences_.user_agent_override; 785 return renderer_preferences_.user_agent_override;
728 } 786 }
729 787
788 void WebContentsImpl::EnableTreeOnlyAccessibilityMode() {
789 AddAccessibilityMode(AccessibilityModeTreeOnly);
790 }
791
792 bool WebContentsImpl::IsTreeOnlyAccessibilityModeForTesting() const {
793 return accessibility_mode() == AccessibilityModeTreeOnly;
794 }
795
796 bool WebContentsImpl::IsFullAccessibilityModeForTesting() const {
797 return accessibility_mode() == AccessibilityModeComplete;
798 }
799
730 #if defined(OS_WIN) 800 #if defined(OS_WIN)
731 void WebContentsImpl::SetParentNativeViewAccessible( 801 void WebContentsImpl::SetParentNativeViewAccessible(
732 gfx::NativeViewAccessible accessible_parent) { 802 gfx::NativeViewAccessible accessible_parent) {
733 accessible_parent_ = accessible_parent; 803 accessible_parent_ = accessible_parent;
734 if (GetRenderViewHost()) 804 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(GetMainFrame());
735 GetRenderViewHostImpl()->SetParentNativeViewAccessible(accessible_parent); 805 if (rfh)
806 rfh->SetParentNativeViewAccessible(accessible_parent);
736 } 807 }
737 #endif 808 #endif
738 809
739 const base::string16& WebContentsImpl::GetTitle() const { 810 const base::string16& WebContentsImpl::GetTitle() const {
740 // Transient entries take precedence. They are used for interstitial pages 811 // Transient entries take precedence. They are used for interstitial pages
741 // that are shown on top of existing pages. 812 // that are shown on top of existing pages.
742 NavigationEntry* entry = controller_.GetTransientEntry(); 813 NavigationEntry* entry = controller_.GetTransientEntry();
743 std::string accept_languages = 814 std::string accept_languages =
744 GetContentClient()->browser()->GetAcceptLangs( 815 GetContentClient()->browser()->GetAcceptLangs(
745 GetBrowserContext()); 816 GetBrowserContext());
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 currentPinchZoomStepDelta_--; 1316 currentPinchZoomStepDelta_--;
1246 if (delegate_) 1317 if (delegate_)
1247 delegate_->ContentsZoomChange(false); 1318 delegate_->ContentsZoomChange(false);
1248 } 1319 }
1249 return true; 1320 return true;
1250 } 1321 }
1251 1322
1252 return false; 1323 return false;
1253 } 1324 }
1254 1325
1255 #if defined(OS_WIN)
1256 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() {
1257 return accessible_parent_;
1258 }
1259 #endif
1260
1261 void WebContentsImpl::HandleMouseDown() { 1326 void WebContentsImpl::HandleMouseDown() {
1262 if (delegate_) 1327 if (delegate_)
1263 delegate_->HandleMouseDown(); 1328 delegate_->HandleMouseDown();
1264 } 1329 }
1265 1330
1266 void WebContentsImpl::HandleMouseUp() { 1331 void WebContentsImpl::HandleMouseUp() {
1267 if (delegate_) 1332 if (delegate_)
1268 delegate_->HandleMouseUp(); 1333 delegate_->HandleMouseUp();
1269 } 1334 }
1270 1335
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 1714
1650 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace( 1715 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace(
1651 SiteInstance* instance) { 1716 SiteInstance* instance) {
1652 return controller_.GetSessionStorageNamespace(instance); 1717 return controller_.GetSessionStorageNamespace(instance);
1653 } 1718 }
1654 1719
1655 FrameTree* WebContentsImpl::GetFrameTree() { 1720 FrameTree* WebContentsImpl::GetFrameTree() {
1656 return &frame_tree_; 1721 return &frame_tree_;
1657 } 1722 }
1658 1723
1724 AccessibilityMode WebContentsImpl::GetAccessibilityMode() const {
1725 return accessibility_mode_;
1726 }
1727
1659 void WebContentsImpl::AccessibilityEventReceived( 1728 void WebContentsImpl::AccessibilityEventReceived(
1660 const std::vector<AXEventNotificationDetails>& details) { 1729 const std::vector<AXEventNotificationDetails>& details) {
1661 FOR_EACH_OBSERVER( 1730 FOR_EACH_OBSERVER(
1662 WebContentsObserver, observers_, AccessibilityEventReceived(details)); 1731 WebContentsObserver, observers_, AccessibilityEventReceived(details));
1663 } 1732 }
1664 1733
1665 void WebContentsImpl::OnShowValidationMessage( 1734 void WebContentsImpl::OnShowValidationMessage(
1666 const gfx::Rect& anchor_in_root_view, 1735 const gfx::Rect& anchor_in_root_view,
1667 const base::string16& main_text, 1736 const base::string16& main_text,
1668 const base::string16& sub_text) { 1737 const base::string16& sub_text) {
(...skipping 11 matching lines...) Expand all
1680 const gfx::Rect& anchor_in_root_view) { 1749 const gfx::Rect& anchor_in_root_view) {
1681 if (delegate_) 1750 if (delegate_)
1682 delegate_->MoveValidationMessage(this, anchor_in_root_view); 1751 delegate_->MoveValidationMessage(this, anchor_in_root_view);
1683 } 1752 }
1684 1753
1685 void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) { 1754 void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) {
1686 if (browser_plugin_embedder_) 1755 if (browser_plugin_embedder_)
1687 browser_plugin_embedder_->DidSendScreenRects(); 1756 browser_plugin_embedder_->DidSendScreenRects();
1688 } 1757 }
1689 1758
1759 BrowserAccessibilityManager*
1760 WebContentsImpl::GetRootBrowserAccessibilityManager() {
1761 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(GetMainFrame());
1762 return rfh ? rfh->browser_accessibility_manager() : NULL;
1763 }
1764
1690 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { 1765 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) {
1691 const gfx::Size old_size = GetPreferredSize(); 1766 const gfx::Size old_size = GetPreferredSize();
1692 preferred_size_ = pref_size; 1767 preferred_size_ = pref_size;
1693 OnPreferredSizeChanged(old_size); 1768 OnPreferredSizeChanged(old_size);
1694 } 1769 }
1695 1770
1696 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { 1771 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) {
1697 if (delegate_) 1772 if (delegate_)
1698 delegate_->ResizeDueToAutoResize(this, new_size); 1773 delegate_->ResizeDueToAutoResize(this, new_size);
1699 } 1774 }
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 WebContents* WebContentsImpl::GetAsWebContents() { 3242 WebContents* WebContentsImpl::GetAsWebContents() {
3168 return this; 3243 return this;
3169 } 3244 }
3170 3245
3171 bool WebContentsImpl::IsNeverVisible() { 3246 bool WebContentsImpl::IsNeverVisible() {
3172 if (!delegate_) 3247 if (!delegate_)
3173 return false; 3248 return false;
3174 return delegate_->IsNeverVisible(this); 3249 return delegate_->IsNeverVisible(this);
3175 } 3250 }
3176 3251
3252 #if defined(OS_WIN)
3253 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() {
3254 return accessible_parent_;
3255 }
3256 #endif
3257
3177 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { 3258 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() {
3178 return render_view_host_delegate_view_; 3259 return render_view_host_delegate_view_;
3179 } 3260 }
3180 3261
3181 RendererPreferences WebContentsImpl::GetRendererPrefs( 3262 RendererPreferences WebContentsImpl::GetRendererPrefs(
3182 BrowserContext* browser_context) const { 3263 BrowserContext* browser_context) const {
3183 return renderer_preferences_; 3264 return renderer_preferences_;
3184 } 3265 }
3185 3266
3186 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const { 3267 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const {
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
3961 4042
3962 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 4043 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3963 if (!delegate_) 4044 if (!delegate_)
3964 return; 4045 return;
3965 const gfx::Size new_size = GetPreferredSize(); 4046 const gfx::Size new_size = GetPreferredSize();
3966 if (new_size != old_size) 4047 if (new_size != old_size)
3967 delegate_->UpdatePreferredSize(this, new_size); 4048 delegate_->UpdatePreferredSize(this, new_size);
3968 } 4049 }
3969 4050
3970 } // namespace content 4051 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698