Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/renderer/render_widget.cc

Issue 3060045: Making window.focus() work in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/test/test_browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/render_widget.h" 5 #include "chrome/renderer/render_widget.h"
6 6
7 #include "app/surface/transport_dib.h" 7 #include "app/surface/transport_dib.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 Send(new ViewHostMsg_ShowPopup(routing_id_, *popup_params_)); 621 Send(new ViewHostMsg_ShowPopup(routing_id_, *popup_params_));
622 popup_params_.reset(); 622 popup_params_.reset();
623 } else { 623 } else {
624 Send(new ViewHostMsg_ShowWidget(opener_id_, routing_id_, initial_pos_)); 624 Send(new ViewHostMsg_ShowWidget(opener_id_, routing_id_, initial_pos_));
625 } 625 }
626 SetPendingWindowRect(initial_pos_); 626 SetPendingWindowRect(initial_pos_);
627 } 627 }
628 } 628 }
629 629
630 void RenderWidget::didFocus() { 630 void RenderWidget::didFocus() {
631 // Prevent the widget from stealing the focus if it does not have focus 631 Send(new ViewHostMsg_Focus(routing_id_));
632 // already. We do this by explicitely setting the focus to false again.
633 // We only let the browser focus the renderer.
634 if (!has_focus_ && webwidget_) {
635 MessageLoop::current()->PostTask(FROM_HERE,
636 NewRunnableMethod(this, &RenderWidget::ClearFocus));
637 }
638 } 632 }
639 633
640 void RenderWidget::didBlur() { 634 void RenderWidget::didBlur() {
641 Send(new ViewHostMsg_Blur(routing_id_)); 635 Send(new ViewHostMsg_Blur(routing_id_));
642 } 636 }
643 637
644 void RenderWidget::DoDeferredClose() { 638 void RenderWidget::DoDeferredClose() {
645 Send(new ViewHostMsg_Close(routing_id_)); 639 Send(new ViewHostMsg_Close(routing_id_));
646 } 640 }
647 641
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 919
926 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { 920 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) {
927 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); 921 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin();
928 i != plugin_window_moves_.end(); ++i) { 922 i != plugin_window_moves_.end(); ++i) {
929 if (i->window == window) { 923 if (i->window == window) {
930 plugin_window_moves_.erase(i); 924 plugin_window_moves_.erase(i);
931 break; 925 break;
932 } 926 }
933 } 927 }
934 } 928 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/test/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698