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" |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1287 | 1287 |
1288 return false; | 1288 return false; |
1289 } | 1289 } |
1290 | 1290 |
1291 #if defined(OS_WIN) | 1291 #if defined(OS_WIN) |
1292 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { | 1292 gfx::NativeViewAccessible WebContentsImpl::GetParentNativeViewAccessible() { |
1293 return accessible_parent_; | 1293 return accessible_parent_; |
1294 } | 1294 } |
1295 #endif | 1295 #endif |
1296 | 1296 |
1297 void WebContentsImpl::DispatchMessageWithSwapFrame(const IPC::Message&) { | |
mkosiba (inactive)
2014/05/06 22:30:33
the web contents would just re-broadcast to all of
| |
1298 ObserverListBase<WebContentsObserver>::Iterator it(observers_); | |
1299 WebContentsObserver* observer; | |
1300 while ((observer = it.GetNext()) != NULL) { | |
1301 // Would it be better to just call observer->OnMessageReceived? | |
1302 if (observer->DispatchMessageWithSwapFrame(message)) | |
1303 return true; | |
1304 } | |
1305 } | |
1306 | |
1297 void WebContentsImpl::HandleMouseDown() { | 1307 void WebContentsImpl::HandleMouseDown() { |
1298 if (delegate_) | 1308 if (delegate_) |
1299 delegate_->HandleMouseDown(); | 1309 delegate_->HandleMouseDown(); |
1300 } | 1310 } |
1301 | 1311 |
1302 void WebContentsImpl::HandleMouseUp() { | 1312 void WebContentsImpl::HandleMouseUp() { |
1303 if (delegate_) | 1313 if (delegate_) |
1304 delegate_->HandleMouseUp(); | 1314 delegate_->HandleMouseUp(); |
1305 } | 1315 } |
1306 | 1316 |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2836 | 2846 |
2837 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { | 2847 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { |
2838 // Chrome OS does its own detection of audio and video. | 2848 // Chrome OS does its own detection of audio and video. |
2839 #if !defined(OS_CHROMEOS) | 2849 #if !defined(OS_CHROMEOS) |
2840 delete power_save_blockers_[render_view_message_source_][player_cookie]; | 2850 delete power_save_blockers_[render_view_message_source_][player_cookie]; |
2841 power_save_blockers_[render_view_message_source_].erase(player_cookie); | 2851 power_save_blockers_[render_view_message_source_].erase(player_cookie); |
2842 #endif // !defined(OS_CHROMEOS) | 2852 #endif // !defined(OS_CHROMEOS) |
2843 } | 2853 } |
2844 | 2854 |
2845 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint(int32 page_id) { | 2855 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint(int32 page_id) { |
2846 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | |
2847 DidFirstVisuallyNonEmptyPaint(page_id)); | |
2848 } | 2856 } |
2849 | 2857 |
2850 void WebContentsImpl::DidChangeVisibleSSLState() { | 2858 void WebContentsImpl::DidChangeVisibleSSLState() { |
2851 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2859 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2852 DidChangeVisibleSSLState()); | 2860 DidChangeVisibleSSLState()); |
2853 } | 2861 } |
2854 | 2862 |
2855 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { | 2863 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { |
2856 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2864 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2857 BeforeFormRepostWarningShow()); | 2865 BeforeFormRepostWarningShow()); |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3858 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(rvh); | 3866 RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(rvh); |
3859 // Can be NULL during tests. | 3867 // Can be NULL during tests. |
3860 if (rwh_view) | 3868 if (rwh_view) |
3861 rwh_view->SetSize(GetView()->GetContainerSize()); | 3869 rwh_view->SetSize(GetView()->GetContainerSize()); |
3862 } | 3870 } |
3863 | 3871 |
3864 bool WebContentsImpl::IsHidden() { | 3872 bool WebContentsImpl::IsHidden() { |
3865 return capturer_count_ == 0 && !should_normally_be_visible_; | 3873 return capturer_count_ == 0 && !should_normally_be_visible_; |
3866 } | 3874 } |
3867 | 3875 |
3876 void WebContentsImpl::WidgetVisibleStateChanged( | |
3877 int32 page_id, | |
3878 WidgetVisibleState widget_visible_state) { | |
3879 if (widget_visible_state == | |
3880 WIDGET_VISIBLE_STATE_FIRST_VISUALLY_NON_EMPTY_LAYOUT) { | |
3881 FOR_EACH_OBSERVER(WebContentsObserver, | |
3882 observers_, | |
3883 DidFirstVisuallyNonEmptyPaint(page_id)); | |
3884 } | |
3885 } | |
3886 | |
3868 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const { | 3887 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const { |
3869 return frame_tree_.root()->render_manager(); | 3888 return frame_tree_.root()->render_manager(); |
3870 } | 3889 } |
3871 | 3890 |
3872 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 3891 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
3873 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 3892 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
3874 } | 3893 } |
3875 | 3894 |
3876 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 3895 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
3877 return browser_plugin_guest_.get(); | 3896 return browser_plugin_guest_.get(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3924 | 3943 |
3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3944 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3926 if (!delegate_) | 3945 if (!delegate_) |
3927 return; | 3946 return; |
3928 const gfx::Size new_size = GetPreferredSize(); | 3947 const gfx::Size new_size = GetPreferredSize(); |
3929 if (new_size != old_size) | 3948 if (new_size != old_size) |
3930 delegate_->UpdatePreferredSize(this, new_size); | 3949 delegate_->UpdatePreferredSize(this, new_size); |
3931 } | 3950 } |
3932 | 3951 |
3933 } // namespace content | 3952 } // namespace content |
OLD | NEW |