OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
10 #include "chrome/browser/renderer_host/backing_store.h" | 10 #include "chrome/browser/renderer_host/backing_store.h" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 << type << "). Ignoring event."; | 724 << type << "). Ignoring event."; |
725 } else { | 725 } else { |
726 bool processed = false; | 726 bool processed = false; |
727 if (!message.ReadBool(&iter, &processed)) | 727 if (!message.ReadBool(&iter, &processed)) |
728 process()->ReceivedBadMessage(message.type()); | 728 process()->ReceivedBadMessage(message.type()); |
729 | 729 |
730 KeyQueue::value_type front_item = key_queue_.front(); | 730 KeyQueue::value_type front_item = key_queue_.front(); |
731 key_queue_.pop(); | 731 key_queue_.pop(); |
732 | 732 |
733 if (!processed) { | 733 if (!processed) { |
734 UnhandledKeyboardEvent(front_item); | 734 // Send the event back to the |view_| first, to give it a chance to |
| 735 // handle it again. |
| 736 if (!view_->UnhandledKeyboardEvent(front_item)) |
| 737 UnhandledKeyboardEvent(front_item); |
735 | 738 |
736 // WARNING: This RenderWidgetHost can be deallocated at this point | 739 // WARNING: This RenderWidgetHost can be deallocated at this point |
737 // (i.e. in the case of Ctrl+W, where the call to | 740 // (i.e. in the case of Ctrl+W, where the call to |
738 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 741 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
739 } | 742 } |
740 } | 743 } |
741 } | 744 } |
742 } | 745 } |
743 | 746 |
744 void RenderWidgetHost::OnMsgFocus() { | 747 void RenderWidgetHost::OnMsgFocus() { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 858 |
856 // TODO(darin): do we need to do something else if our backing store is not | 859 // TODO(darin): do we need to do something else if our backing store is not |
857 // the same size as the advertised view? maybe we just assume there is a | 860 // the same size as the advertised view? maybe we just assume there is a |
858 // full paint on its way? | 861 // full paint on its way? |
859 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 862 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
860 if (!backing_store || (backing_store->size() != view_size)) | 863 if (!backing_store || (backing_store->size() != view_size)) |
861 return; | 864 return; |
862 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 865 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
863 dx, dy, clip_rect, view_size); | 866 dx, dy, clip_rect, view_size); |
864 } | 867 } |
OLD | NEW |