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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 565 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
566 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 566 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
567 OnRegisterProtocolHandler) | 567 OnRegisterProtocolHandler) |
568 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 568 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
569 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 569 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
570 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 570 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
571 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) | 571 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) |
572 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) | 572 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) |
573 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, | 573 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, |
574 OnSetSelectedColorInColorChooser) | 574 OnSetSelectedColorInColorChooser) |
| 575 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) |
575 IPC_MESSAGE_UNHANDLED(handled = false) | 576 IPC_MESSAGE_UNHANDLED(handled = false) |
576 IPC_END_MESSAGE_MAP_EX() | 577 IPC_END_MESSAGE_MAP_EX() |
577 | 578 |
578 if (!message_is_ok) { | 579 if (!message_is_ok) { |
579 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 580 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
580 GetRenderProcessHost()->ReceivedBadMessage(); | 581 GetRenderProcessHost()->ReceivedBadMessage(); |
581 } | 582 } |
582 | 583 |
583 return handled; | 584 return handled; |
584 } | 585 } |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 color_chooser_->End(); | 1755 color_chooser_->End(); |
1755 } | 1756 } |
1756 | 1757 |
1757 void TabContents::OnSetSelectedColorInColorChooser(int color_chooser_id, | 1758 void TabContents::OnSetSelectedColorInColorChooser(int color_chooser_id, |
1758 const SkColor& color) { | 1759 const SkColor& color) { |
1759 if (color_chooser_ && | 1760 if (color_chooser_ && |
1760 color_chooser_id == color_chooser_->identifier()) | 1761 color_chooser_id == color_chooser_->identifier()) |
1761 color_chooser_->SetSelectedColor(color); | 1762 color_chooser_->SetSelectedColor(color); |
1762 } | 1763 } |
1763 | 1764 |
| 1765 void TabContents::OnPepperPluginHung(int plugin_child_id, |
| 1766 const FilePath& path, |
| 1767 bool is_hung) { |
| 1768 if (delegate_) |
| 1769 delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung); |
| 1770 } |
| 1771 |
1764 // Notifies the RenderWidgetHost instance about the fact that the page is | 1772 // Notifies the RenderWidgetHost instance about the fact that the page is |
1765 // loading, or done loading and calls the base implementation. | 1773 // loading, or done loading and calls the base implementation. |
1766 void TabContents::SetIsLoading(bool is_loading, | 1774 void TabContents::SetIsLoading(bool is_loading, |
1767 LoadNotificationDetails* details) { | 1775 LoadNotificationDetails* details) { |
1768 if (is_loading == is_loading_) | 1776 if (is_loading == is_loading_) |
1769 return; | 1777 return; |
1770 | 1778 |
1771 if (!is_loading) { | 1779 if (!is_loading) { |
1772 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 1780 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
1773 load_state_host_.clear(); | 1781 load_state_host_.clear(); |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2608 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2601 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2609 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2602 // Can be NULL during tests. | 2610 // Can be NULL during tests. |
2603 if (rwh_view) | 2611 if (rwh_view) |
2604 rwh_view->SetSize(GetView()->GetContainerSize()); | 2612 rwh_view->SetSize(GetView()->GetContainerSize()); |
2605 } | 2613 } |
2606 | 2614 |
2607 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { | 2615 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { |
2608 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2616 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
2609 } | 2617 } |
OLD | NEW |