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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 632 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
633 } | 633 } |
634 | 634 |
635 void BrowserPluginGuest::RenderViewReady() { | 635 void BrowserPluginGuest::RenderViewReady() { |
636 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); | 636 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); |
637 // TODO(fsamuel): Investigate whether it's possible to update state earlier | 637 // TODO(fsamuel): Investigate whether it's possible to update state earlier |
638 // here (see http://crbug.com/158151). | 638 // here (see http://crbug.com/158151). |
639 Send(new InputMsg_SetFocus(routing_id(), focused_)); | 639 Send(new InputMsg_SetFocus(routing_id(), focused_)); |
640 UpdateVisibility(); | 640 UpdateVisibility(); |
641 | 641 |
| 642 // In case we've created a new guest render process after a crash, let the |
| 643 // associated BrowserPlugin know. We only need to send this if we're attached, |
| 644 // as guest_crashed_ is cleared automatically on attach anyways. |
| 645 if (attached()) { |
| 646 SendMessageToEmbedder( |
| 647 new BrowserPluginMsg_GuestReady(browser_plugin_instance_id())); |
| 648 } |
| 649 |
642 RenderWidgetHostImpl::From(rvh->GetWidget()) | 650 RenderWidgetHostImpl::From(rvh->GetWidget()) |
643 ->set_hung_renderer_delay( | 651 ->set_hung_renderer_delay( |
644 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)); | 652 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)); |
645 } | 653 } |
646 | 654 |
647 void BrowserPluginGuest::RenderProcessGone(base::TerminationStatus status) { | 655 void BrowserPluginGuest::RenderProcessGone(base::TerminationStatus status) { |
648 SendMessageToEmbedder( | 656 SendMessageToEmbedder( |
649 new BrowserPluginMsg_GuestGone(browser_plugin_instance_id())); | 657 new BrowserPluginMsg_GuestGone(browser_plugin_instance_id())); |
650 switch (status) { | 658 switch (status) { |
651 #if defined(OS_CHROMEOS) | 659 #if defined(OS_CHROMEOS) |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 range, character_bounds); | 1034 range, character_bounds); |
1027 } | 1035 } |
1028 #endif | 1036 #endif |
1029 | 1037 |
1030 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1038 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1031 if (delegate_) | 1039 if (delegate_) |
1032 delegate_->SetContextMenuPosition(position); | 1040 delegate_->SetContextMenuPosition(position); |
1033 } | 1041 } |
1034 | 1042 |
1035 } // namespace content | 1043 } // namespace content |
OLD | NEW |