| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 569 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
| 570 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 570 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
| 571 OnRegisterProtocolHandler) | 571 OnRegisterProtocolHandler) |
| 572 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 572 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
| 573 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 573 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
| 574 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 574 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
| 575 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) | 575 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) |
| 576 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) | 576 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) |
| 577 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, | 577 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, |
| 578 OnSetSelectedColorInColorChooser) | 578 OnSetSelectedColorInColorChooser) |
| 579 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) |
| 579 IPC_MESSAGE_UNHANDLED(handled = false) | 580 IPC_MESSAGE_UNHANDLED(handled = false) |
| 580 IPC_END_MESSAGE_MAP_EX() | 581 IPC_END_MESSAGE_MAP_EX() |
| 581 | 582 |
| 582 if (!message_is_ok) { | 583 if (!message_is_ok) { |
| 583 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 584 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
| 584 GetRenderProcessHost()->ReceivedBadMessage(); | 585 GetRenderProcessHost()->ReceivedBadMessage(); |
| 585 } | 586 } |
| 586 | 587 |
| 587 return handled; | 588 return handled; |
| 588 } | 589 } |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 color_chooser_->End(); | 1765 color_chooser_->End(); |
| 1765 } | 1766 } |
| 1766 | 1767 |
| 1767 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, | 1768 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, |
| 1768 const SkColor& color) { | 1769 const SkColor& color) { |
| 1769 if (color_chooser_ && | 1770 if (color_chooser_ && |
| 1770 color_chooser_id == color_chooser_->identifier()) | 1771 color_chooser_id == color_chooser_->identifier()) |
| 1771 color_chooser_->SetSelectedColor(color); | 1772 color_chooser_->SetSelectedColor(color); |
| 1772 } | 1773 } |
| 1773 | 1774 |
| 1775 void TabContents::OnPepperPluginHung(int plugin_child_id, |
| 1776 const FilePath& path, |
| 1777 bool is_hung) { |
| 1778 if (delegate_) |
| 1779 delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung); |
| 1780 } |
| 1781 |
| 1774 // Notifies the RenderWidgetHost instance about the fact that the page is | 1782 // Notifies the RenderWidgetHost instance about the fact that the page is |
| 1775 // loading, or done loading and calls the base implementation. | 1783 // loading, or done loading and calls the base implementation. |
| 1776 void WebContentsImpl::SetIsLoading(bool is_loading, | 1784 void WebContentsImpl::SetIsLoading(bool is_loading, |
| 1777 LoadNotificationDetails* details) { | 1785 LoadNotificationDetails* details) { |
| 1778 if (is_loading == is_loading_) | 1786 if (is_loading == is_loading_) |
| 1779 return; | 1787 return; |
| 1780 | 1788 |
| 1781 if (!is_loading) { | 1789 if (!is_loading) { |
| 1782 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 1790 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
| 1783 load_state_host_.clear(); | 1791 load_state_host_.clear(); |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2623 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2616 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2624 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2617 // Can be NULL during tests. | 2625 // Can be NULL during tests. |
| 2618 if (rwh_view) | 2626 if (rwh_view) |
| 2619 rwh_view->SetSize(GetView()->GetContainerSize()); | 2627 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2620 } | 2628 } |
| 2621 | 2629 |
| 2622 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2630 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2623 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2631 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2624 } | 2632 } |
| OLD | NEW |