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/renderer/render_widget.h" | 5 #include "chrome/renderer/render_widget.h" |
6 | 6 |
7 #include "base/gfx/point.h" | 7 #include "base/gfx/point.h" |
8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 Send(new ViewHostMsg_ShowPopup(routing_id_, *popup_params_)); | 643 Send(new ViewHostMsg_ShowPopup(routing_id_, *popup_params_)); |
644 popup_params_.reset(); | 644 popup_params_.reset(); |
645 } else { | 645 } else { |
646 Send(new ViewHostMsg_ShowWidget(opener_id_, routing_id_, initial_pos_)); | 646 Send(new ViewHostMsg_ShowWidget(opener_id_, routing_id_, initial_pos_)); |
647 } | 647 } |
648 SetPendingWindowRect(initial_pos_); | 648 SetPendingWindowRect(initial_pos_); |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 void RenderWidget::didFocus() { | 652 void RenderWidget::didFocus() { |
| 653 // Note that didFocus() is invoked everytime a new node is focused in the |
| 654 // page. It could be expected that it would be called only when the widget |
| 655 // gets the focus. If the current behavior was to change in WebKit for the |
| 656 // expected one, the following notification would not work anymore. |
| 657 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_)); |
| 658 |
653 // Prevent the widget from stealing the focus if it does not have focus | 659 // Prevent the widget from stealing the focus if it does not have focus |
654 // already. We do this by explicitely setting the focus to false again. | 660 // already. We do this by explicitely setting the focus to false again. |
655 // We only let the browser focus the renderer. | 661 // We only let the browser focus the renderer. |
656 if (!has_focus_ && webwidget_) { | 662 if (!has_focus_ && webwidget_) { |
657 MessageLoop::current()->PostTask(FROM_HERE, | 663 MessageLoop::current()->PostTask(FROM_HERE, |
658 NewRunnableMethod(this, &RenderWidget::ClearFocus)); | 664 NewRunnableMethod(this, &RenderWidget::ClearFocus)); |
659 } | 665 } |
660 } | 666 } |
661 | 667 |
662 void RenderWidget::didBlur() { | 668 void RenderWidget::didBlur() { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 | 910 |
905 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 911 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
906 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 912 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
907 i != plugin_window_moves_.end(); ++i) { | 913 i != plugin_window_moves_.end(); ++i) { |
908 if (i->window == window) { | 914 if (i->window == window) { |
909 plugin_window_moves_.erase(i); | 915 plugin_window_moves_.erase(i); |
910 break; | 916 break; |
911 } | 917 } |
912 } | 918 } |
913 } | 919 } |
OLD | NEW |