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 #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 Loading... |
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 on_frame.Run(node->current_frame_host()); | 213 on_frame.Run(node->current_frame_host()); |
211 return true; | 214 return true; |
212 } | 215 } |
213 | 216 |
214 void SendToAllFramesInternal(IPC::Message* message, RenderFrameHost* rfh) { | 217 void SendToAllFramesInternal(IPC::Message* message, RenderFrameHost* rfh) { |
215 IPC::Message* message_copy = new IPC::Message(*message); | 218 IPC::Message* message_copy = new IPC::Message(*message); |
216 message_copy->set_routing_id(rfh->GetRoutingID()); | 219 message_copy->set_routing_id(rfh->GetRoutingID()); |
217 rfh->Send(message_copy); | 220 rfh->Send(message_copy); |
218 } | 221 } |
219 | 222 |
| 223 void SetAccessibilityModeOnFrame(AccessibilityMode mode, |
| 224 RenderFrameHost* frame_host) { |
| 225 static_cast<RenderFrameHostImpl*>(frame_host)->SetAccessibilityMode(mode); |
| 226 } |
| 227 |
220 } // namespace | 228 } // namespace |
221 | 229 |
222 WebContents* WebContents::Create(const WebContents::CreateParams& params) { | 230 WebContents* WebContents::Create(const WebContents::CreateParams& params) { |
223 return WebContentsImpl::CreateWithOpener( | 231 return WebContentsImpl::CreateWithOpener( |
224 params, static_cast<WebContentsImpl*>(params.opener)); | 232 params, static_cast<WebContentsImpl*>(params.opener)); |
225 } | 233 } |
226 | 234 |
227 WebContents* WebContents::CreateWithSessionStorage( | 235 WebContents* WebContents::CreateWithSessionStorage( |
228 const WebContents::CreateParams& params, | 236 const WebContents::CreateParams& params, |
229 const SessionStorageNamespaceMap& session_storage_namespace_map) { | 237 const SessionStorageNamespaceMap& session_storage_namespace_map) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 last_active_time_(base::TimeTicks::Now()), | 345 last_active_time_(base::TimeTicks::Now()), |
338 closed_by_user_gesture_(false), | 346 closed_by_user_gesture_(false), |
339 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), | 347 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), |
340 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), | 348 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), |
341 temporary_zoom_settings_(false), | 349 temporary_zoom_settings_(false), |
342 totalPinchGestureAmount_(0), | 350 totalPinchGestureAmount_(0), |
343 currentPinchZoomStepDelta_(0), | 351 currentPinchZoomStepDelta_(0), |
344 render_view_message_source_(NULL), | 352 render_view_message_source_(NULL), |
345 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), | 353 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), |
346 is_subframe_(false), | 354 is_subframe_(false), |
347 last_dialog_suppressed_(false) { | 355 last_dialog_suppressed_(false), |
| 356 accessibility_mode_( |
| 357 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()) { |
348 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) | 358 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) |
349 g_created_callbacks.Get().at(i).Run(this); | 359 g_created_callbacks.Get().at(i).Run(this); |
350 frame_tree_.SetFrameRemoveListener( | 360 frame_tree_.SetFrameRemoveListener( |
351 base::Bind(&WebContentsImpl::OnFrameRemoved, | 361 base::Bind(&WebContentsImpl::OnFrameRemoved, |
352 base::Unretained(this))); | 362 base::Unretained(this))); |
353 } | 363 } |
354 | 364 |
355 WebContentsImpl::~WebContentsImpl() { | 365 WebContentsImpl::~WebContentsImpl() { |
356 is_being_destroyed_ = true; | 366 is_being_destroyed_ = true; |
357 | 367 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 extra_params.Pass(), | 451 extra_params.Pass(), |
442 opener ? opener->GetBrowserPluginGuest() : NULL); | 452 opener ? opener->GetBrowserPluginGuest() : NULL); |
443 // We are instantiating a WebContents for browser plugin. Set its subframe | 453 // We are instantiating a WebContents for browser plugin. Set its subframe |
444 // bit to true. | 454 // bit to true. |
445 new_contents->is_subframe_ = true; | 455 new_contents->is_subframe_ = true; |
446 } | 456 } |
447 new_contents->Init(params); | 457 new_contents->Init(params); |
448 return new_contents; | 458 return new_contents; |
449 } | 459 } |
450 | 460 |
| 461 // static |
| 462 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() { |
| 463 std::vector<WebContentsImpl*> result; |
| 464 scoped_ptr<RenderWidgetHostIterator> widgets( |
| 465 RenderWidgetHostImpl::GetRenderWidgetHosts()); |
| 466 std::set<WebContentsImpl*> web_contents_set; |
| 467 while (RenderWidgetHost* rwh = widgets->GetNextHost()) { |
| 468 if (!rwh->IsRenderView()) |
| 469 continue; |
| 470 RenderViewHost* rvh = RenderViewHost::From(rwh); |
| 471 if (!rvh) |
| 472 continue; |
| 473 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 474 if (!web_contents) |
| 475 continue; |
| 476 WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents); |
| 477 if (web_contents_set.find(wci) == web_contents_set.end()) { |
| 478 web_contents_set.insert(wci); |
| 479 result.push_back(wci); |
| 480 } |
| 481 } |
| 482 return result; |
| 483 } |
| 484 |
451 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() { | 485 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() { |
452 return GetRenderManager(); | 486 return GetRenderManager(); |
453 } | 487 } |
454 | 488 |
455 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, | 489 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
456 const IPC::Message& message) { | 490 const IPC::Message& message) { |
457 return OnMessageReceived(render_view_host, NULL, message); | 491 return OnMessageReceived(render_view_host, NULL, message); |
458 } | 492 } |
459 | 493 |
460 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, | 494 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 RenderWidgetHost* const widget_host = | 697 RenderWidgetHost* const widget_host = |
664 RenderWidgetHostImpl::FromID(GetRenderProcessHost()->GetID(), | 698 RenderWidgetHostImpl::FromID(GetRenderProcessHost()->GetID(), |
665 GetFullscreenWidgetRoutingID()); | 699 GetFullscreenWidgetRoutingID()); |
666 return widget_host ? widget_host->GetView() : NULL; | 700 return widget_host ? widget_host->GetView() : NULL; |
667 } | 701 } |
668 | 702 |
669 WebContentsView* WebContentsImpl::GetView() const { | 703 WebContentsView* WebContentsImpl::GetView() const { |
670 return view_.get(); | 704 return view_.get(); |
671 } | 705 } |
672 | 706 |
| 707 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) { |
| 708 if (mode == accessibility_mode_) |
| 709 return; |
| 710 |
| 711 accessibility_mode_ = mode; |
| 712 frame_tree_.ForEach( |
| 713 base::Bind(&ForEachFrameInternal, |
| 714 base::Bind(&SetAccessibilityModeOnFrame, mode))); |
| 715 frame_tree_.ForEach( |
| 716 base::Bind(&ForEachPendingFrameInternal, |
| 717 base::Bind(&SetAccessibilityModeOnFrame, mode))); |
| 718 } |
| 719 |
| 720 void WebContentsImpl::AddAccessibilityMode(AccessibilityMode mode) { |
| 721 SetAccessibilityMode( |
| 722 content::AddAccessibilityModeTo(accessibility_mode_, mode)); |
| 723 } |
| 724 |
| 725 void WebContentsImpl::RemoveAccessibilityMode(AccessibilityMode mode) { |
| 726 SetAccessibilityMode( |
| 727 content::RemoveAccessibilityModeFrom(accessibility_mode_, mode)); |
| 728 } |
| 729 |
673 WebUI* WebContentsImpl::CreateWebUI(const GURL& url) { | 730 WebUI* WebContentsImpl::CreateWebUI(const GURL& url) { |
674 WebUIImpl* web_ui = new WebUIImpl(this); | 731 WebUIImpl* web_ui = new WebUIImpl(this); |
675 WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> | 732 WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> |
676 CreateWebUIControllerForURL(web_ui, url); | 733 CreateWebUIControllerForURL(web_ui, url); |
677 if (controller) { | 734 if (controller) { |
678 web_ui->AddMessageHandler(new GenericHandler()); | 735 web_ui->AddMessageHandler(new GenericHandler()); |
679 web_ui->SetController(controller); | 736 web_ui->SetController(controller); |
680 return web_ui; | 737 return web_ui; |
681 } | 738 } |
682 | 739 |
(...skipping 28 matching lines...) Expand all Loading... |
711 controller_.ReloadIgnoringCache(true); | 768 controller_.ReloadIgnoringCache(true); |
712 | 769 |
713 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 770 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
714 UserAgentOverrideSet(override)); | 771 UserAgentOverrideSet(override)); |
715 } | 772 } |
716 | 773 |
717 const std::string& WebContentsImpl::GetUserAgentOverride() const { | 774 const std::string& WebContentsImpl::GetUserAgentOverride() const { |
718 return renderer_preferences_.user_agent_override; | 775 return renderer_preferences_.user_agent_override; |
719 } | 776 } |
720 | 777 |
| 778 void WebContentsImpl::EnableTreeOnlyAccessibilityMode() { |
| 779 AddAccessibilityMode(AccessibilityModeTreeOnly); |
| 780 } |
| 781 |
| 782 bool WebContentsImpl::IsTreeOnlyAccessibilityModeForTesting() const { |
| 783 return accessibility_mode() == AccessibilityModeTreeOnly; |
| 784 } |
| 785 |
| 786 bool WebContentsImpl::IsFullAccessibilityModeForTesting() const { |
| 787 return accessibility_mode() == AccessibilityModeComplete; |
| 788 } |
| 789 |
721 #if defined(OS_WIN) | 790 #if defined(OS_WIN) |
722 void WebContentsImpl::SetParentNativeViewAccessible( | 791 void WebContentsImpl::SetParentNativeViewAccessible( |
723 gfx::NativeViewAccessible accessible_parent) { | 792 gfx::NativeViewAccessible accessible_parent) { |
724 accessible_parent_ = accessible_parent; | 793 accessible_parent_ = accessible_parent; |
725 if (GetRenderViewHost()) | 794 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(GetMainFrame()); |
726 GetRenderViewHostImpl()->SetParentNativeViewAccessible(accessible_parent); | 795 if (rfh) |
| 796 rfh->SetParentNativeViewAccessible(accessible_parent); |
727 } | 797 } |
728 #endif | 798 #endif |
729 | 799 |
730 const base::string16& WebContentsImpl::GetTitle() const { | 800 const base::string16& WebContentsImpl::GetTitle() const { |
731 // Transient entries take precedence. They are used for interstitial pages | 801 // Transient entries take precedence. They are used for interstitial pages |
732 // that are shown on top of existing pages. | 802 // that are shown on top of existing pages. |
733 NavigationEntry* entry = controller_.GetTransientEntry(); | 803 NavigationEntry* entry = controller_.GetTransientEntry(); |
734 std::string accept_languages = | 804 std::string accept_languages = |
735 GetContentClient()->browser()->GetAcceptLangs( | 805 GetContentClient()->browser()->GetAcceptLangs( |
736 GetBrowserContext()); | 806 GetBrowserContext()); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 currentPinchZoomStepDelta_--; | 1310 currentPinchZoomStepDelta_--; |
1241 if (delegate_) | 1311 if (delegate_) |
1242 delegate_->ContentsZoomChange(false); | 1312 delegate_->ContentsZoomChange(false); |
1243 } | 1313 } |
1244 return true; | 1314 return true; |
1245 } | 1315 } |
1246 | 1316 |
1247 return false; | 1317 return false; |
1248 } | 1318 } |
1249 | 1319 |
1250 #if defined(OS_WIN) | |
1251 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { | |
1252 return accessible_parent_; | |
1253 } | |
1254 #endif | |
1255 | |
1256 void WebContentsImpl::HandleMouseDown() { | 1320 void WebContentsImpl::HandleMouseDown() { |
1257 if (delegate_) | 1321 if (delegate_) |
1258 delegate_->HandleMouseDown(); | 1322 delegate_->HandleMouseDown(); |
1259 } | 1323 } |
1260 | 1324 |
1261 void WebContentsImpl::HandleMouseUp() { | 1325 void WebContentsImpl::HandleMouseUp() { |
1262 if (delegate_) | 1326 if (delegate_) |
1263 delegate_->HandleMouseUp(); | 1327 delegate_->HandleMouseUp(); |
1264 } | 1328 } |
1265 | 1329 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 | 1700 |
1637 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace( | 1701 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace( |
1638 SiteInstance* instance) { | 1702 SiteInstance* instance) { |
1639 return controller_.GetSessionStorageNamespace(instance); | 1703 return controller_.GetSessionStorageNamespace(instance); |
1640 } | 1704 } |
1641 | 1705 |
1642 FrameTree* WebContentsImpl::GetFrameTree() { | 1706 FrameTree* WebContentsImpl::GetFrameTree() { |
1643 return &frame_tree_; | 1707 return &frame_tree_; |
1644 } | 1708 } |
1645 | 1709 |
| 1710 AccessibilityMode WebContentsImpl::GetAccessibilityMode() const { |
| 1711 return accessibility_mode_; |
| 1712 } |
| 1713 |
1646 void WebContentsImpl::AccessibilityEventReceived( | 1714 void WebContentsImpl::AccessibilityEventReceived( |
1647 const std::vector<AXEventNotificationDetails>& details) { | 1715 const std::vector<AXEventNotificationDetails>& details) { |
1648 FOR_EACH_OBSERVER( | 1716 FOR_EACH_OBSERVER( |
1649 WebContentsObserver, observers_, AccessibilityEventReceived(details)); | 1717 WebContentsObserver, observers_, AccessibilityEventReceived(details)); |
1650 } | 1718 } |
1651 | 1719 |
1652 void WebContentsImpl::OnShowValidationMessage( | 1720 void WebContentsImpl::OnShowValidationMessage( |
1653 const gfx::Rect& anchor_in_root_view, | 1721 const gfx::Rect& anchor_in_root_view, |
1654 const base::string16& main_text, | 1722 const base::string16& main_text, |
1655 const base::string16& sub_text) { | 1723 const base::string16& sub_text) { |
(...skipping 11 matching lines...) Expand all Loading... |
1667 const gfx::Rect& anchor_in_root_view) { | 1735 const gfx::Rect& anchor_in_root_view) { |
1668 if (delegate_) | 1736 if (delegate_) |
1669 delegate_->MoveValidationMessage(this, anchor_in_root_view); | 1737 delegate_->MoveValidationMessage(this, anchor_in_root_view); |
1670 } | 1738 } |
1671 | 1739 |
1672 void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) { | 1740 void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) { |
1673 if (browser_plugin_embedder_) | 1741 if (browser_plugin_embedder_) |
1674 browser_plugin_embedder_->DidSendScreenRects(); | 1742 browser_plugin_embedder_->DidSendScreenRects(); |
1675 } | 1743 } |
1676 | 1744 |
| 1745 BrowserAccessibilityManager* |
| 1746 WebContentsImpl::GetRootBrowserAccessibilityManager() { |
| 1747 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(GetMainFrame()); |
| 1748 return rfh ? rfh->browser_accessibility_manager() : NULL; |
| 1749 } |
| 1750 |
1677 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { | 1751 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { |
1678 const gfx::Size old_size = GetPreferredSize(); | 1752 const gfx::Size old_size = GetPreferredSize(); |
1679 preferred_size_ = pref_size; | 1753 preferred_size_ = pref_size; |
1680 OnPreferredSizeChanged(old_size); | 1754 OnPreferredSizeChanged(old_size); |
1681 } | 1755 } |
1682 | 1756 |
1683 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { | 1757 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { |
1684 if (delegate_) | 1758 if (delegate_) |
1685 delegate_->ResizeDueToAutoResize(this, new_size); | 1759 delegate_->ResizeDueToAutoResize(this, new_size); |
1686 } | 1760 } |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3276 WebContents* WebContentsImpl::GetAsWebContents() { | 3350 WebContents* WebContentsImpl::GetAsWebContents() { |
3277 return this; | 3351 return this; |
3278 } | 3352 } |
3279 | 3353 |
3280 bool WebContentsImpl::IsNeverVisible() { | 3354 bool WebContentsImpl::IsNeverVisible() { |
3281 if (!delegate_) | 3355 if (!delegate_) |
3282 return false; | 3356 return false; |
3283 return delegate_->IsNeverVisible(this); | 3357 return delegate_->IsNeverVisible(this); |
3284 } | 3358 } |
3285 | 3359 |
| 3360 #if defined(OS_WIN) |
| 3361 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { |
| 3362 return accessible_parent_; |
| 3363 } |
| 3364 #endif |
| 3365 |
3286 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { | 3366 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { |
3287 return render_view_host_delegate_view_; | 3367 return render_view_host_delegate_view_; |
3288 } | 3368 } |
3289 | 3369 |
3290 RendererPreferences WebContentsImpl::GetRendererPrefs( | 3370 RendererPreferences WebContentsImpl::GetRendererPrefs( |
3291 BrowserContext* browser_context) const { | 3371 BrowserContext* browser_context) const { |
3292 return renderer_preferences_; | 3372 return renderer_preferences_; |
3293 } | 3373 } |
3294 | 3374 |
3295 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const { | 3375 gfx::Rect WebContentsImpl::GetRootWindowResizerRect() const { |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4066 | 4146 |
4067 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4147 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4068 if (!delegate_) | 4148 if (!delegate_) |
4069 return; | 4149 return; |
4070 const gfx::Size new_size = GetPreferredSize(); | 4150 const gfx::Size new_size = GetPreferredSize(); |
4071 if (new_size != old_size) | 4151 if (new_size != old_size) |
4072 delegate_->UpdatePreferredSize(this, new_size); | 4152 delegate_->UpdatePreferredSize(this, new_size); |
4073 } | 4153 } |
4074 | 4154 |
4075 } // namespace content | 4155 } // namespace content |
OLD | NEW |