OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // only place we use this is for the case of dropdown menus and other | 567 // only place we use this is for the case of dropdown menus and other |
568 // edge cases for which edit commands don't make sense. | 568 // edge cases for which edit commands don't make sense. |
569 } | 569 } |
570 | 570 |
571 void RenderWidgetHost::ForwardEditCommandsForNextKeyEvent( | 571 void RenderWidgetHost::ForwardEditCommandsForNextKeyEvent( |
572 const EditCommands& edit_commands) { | 572 const EditCommands& edit_commands) { |
573 // We don't need an implementation of this function here since this message is | 573 // We don't need an implementation of this function here since this message is |
574 // only handled by RenderView. | 574 // only handled by RenderView. |
575 } | 575 } |
576 | 576 |
577 void RenderWidgetHost::RendererExited() { | 577 void RenderWidgetHost::RendererExited(base::TerminationStatus status, |
| 578 int exit_code) { |
578 // Clearing this flag causes us to re-create the renderer when recovering | 579 // Clearing this flag causes us to re-create the renderer when recovering |
579 // from a crashed renderer. | 580 // from a crashed renderer. |
580 renderer_initialized_ = false; | 581 renderer_initialized_ = false; |
581 | 582 |
582 // Must reset these to ensure that mouse move/wheel events work with a new | 583 // Must reset these to ensure that mouse move/wheel events work with a new |
583 // renderer. | 584 // renderer. |
584 mouse_move_pending_ = false; | 585 mouse_move_pending_ = false; |
585 next_mouse_move_.reset(); | 586 next_mouse_move_.reset(); |
586 mouse_wheel_pending_ = false; | 587 mouse_wheel_pending_ = false; |
587 coalesced_mouse_wheel_events_.clear(); | 588 coalesced_mouse_wheel_events_.clear(); |
588 | 589 |
589 // Must reset these to ensure that keyboard events work with a new renderer. | 590 // Must reset these to ensure that keyboard events work with a new renderer. |
590 key_queue_.clear(); | 591 key_queue_.clear(); |
591 suppress_next_char_events_ = false; | 592 suppress_next_char_events_ = false; |
592 | 593 |
593 // Reset some fields in preparation for recovering from a crash. | 594 // Reset some fields in preparation for recovering from a crash. |
594 resize_ack_pending_ = false; | 595 resize_ack_pending_ = false; |
595 repaint_ack_pending_ = false; | 596 repaint_ack_pending_ = false; |
596 | 597 |
597 in_flight_size_.SetSize(0, 0); | 598 in_flight_size_.SetSize(0, 0); |
598 current_size_.SetSize(0, 0); | 599 current_size_.SetSize(0, 0); |
599 is_hidden_ = false; | 600 is_hidden_ = false; |
600 | 601 |
601 if (view_) { | 602 if (view_) { |
602 view_->RenderViewGone(); | 603 view_->RenderViewGone(status, exit_code); |
603 view_ = NULL; // The View should be deleted by RenderViewGone. | 604 view_ = NULL; // The View should be deleted by RenderViewGone. |
604 } | 605 } |
605 | 606 |
606 BackingStoreManager::RemoveBackingStore(this); | 607 BackingStoreManager::RemoveBackingStore(this); |
607 } | 608 } |
608 | 609 |
609 void RenderWidgetHost::UpdateTextDirection(WebTextDirection direction) { | 610 void RenderWidgetHost::UpdateTextDirection(WebTextDirection direction) { |
610 text_direction_updated_ = true; | 611 text_direction_updated_ = true; |
611 text_direction_ = direction; | 612 text_direction_ = direction; |
612 } | 613 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 if (is_unresponsive_) { | 703 if (is_unresponsive_) { |
703 is_unresponsive_ = false; | 704 is_unresponsive_ = false; |
704 NotifyRendererResponsive(); | 705 NotifyRendererResponsive(); |
705 } | 706 } |
706 } | 707 } |
707 | 708 |
708 void RenderWidgetHost::OnMsgRenderViewReady() { | 709 void RenderWidgetHost::OnMsgRenderViewReady() { |
709 WasResized(); | 710 WasResized(); |
710 } | 711 } |
711 | 712 |
712 void RenderWidgetHost::OnMsgRenderViewGone() { | 713 void RenderWidgetHost::OnMsgRenderViewGone(int status, int exit_code) { |
713 // TODO(evanm): This synchronously ends up calling "delete this". | 714 // TODO(evanm): This synchronously ends up calling "delete this". |
714 // Is that really what we want in response to this message? I'm matching | 715 // Is that really what we want in response to this message? I'm matching |
715 // previous behavior of the code here. | 716 // previous behavior of the code here. |
716 Destroy(); | 717 Destroy(); |
717 } | 718 } |
718 | 719 |
719 void RenderWidgetHost::OnMsgClose() { | 720 void RenderWidgetHost::OnMsgClose() { |
720 Shutdown(); | 721 Shutdown(); |
721 } | 722 } |
722 | 723 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 // of this key event. | 1206 // of this key event. |
1206 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { | 1207 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { |
1207 UnhandledKeyboardEvent(front_item); | 1208 UnhandledKeyboardEvent(front_item); |
1208 | 1209 |
1209 // WARNING: This RenderWidgetHost can be deallocated at this point | 1210 // WARNING: This RenderWidgetHost can be deallocated at this point |
1210 // (i.e. in the case of Ctrl+W, where the call to | 1211 // (i.e. in the case of Ctrl+W, where the call to |
1211 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 1212 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
1212 } | 1213 } |
1213 } | 1214 } |
1214 } | 1215 } |
OLD | NEW |