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

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

Issue 1400003003: Move has_focus_ tracking from RenderWidget to RenderView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Leave OnSetFocus plumbing alone Created 5 years, 2 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
OLDNEW
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/dump_without_crashing.h" 10 #include "base/debug/dump_without_crashing.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 top_controls_shrink_blink_size_(false), 489 top_controls_shrink_blink_size_(false),
490 top_controls_height_(0.f), 490 top_controls_height_(0.f),
491 next_paint_flags_(0), 491 next_paint_flags_(0),
492 auto_resize_mode_(false), 492 auto_resize_mode_(false),
493 need_update_rect_for_auto_resize_(false), 493 need_update_rect_for_auto_resize_(false),
494 did_show_(false), 494 did_show_(false),
495 is_hidden_(hidden), 495 is_hidden_(hidden),
496 compositor_never_visible_(never_visible), 496 compositor_never_visible_(never_visible),
497 is_fullscreen_granted_(false), 497 is_fullscreen_granted_(false),
498 display_mode_(blink::WebDisplayModeUndefined), 498 display_mode_(blink::WebDisplayModeUndefined),
499 has_focus_(false),
500 handling_input_event_(false), 499 handling_input_event_(false),
501 handling_event_overscroll_(nullptr), 500 handling_event_overscroll_(nullptr),
502 handling_ime_event_(false), 501 handling_ime_event_(false),
503 handling_event_type_(WebInputEvent::Undefined), 502 handling_event_type_(WebInputEvent::Undefined),
504 ignore_ack_for_mouse_move_from_debugger_(false), 503 ignore_ack_for_mouse_move_from_debugger_(false),
505 closing_(false), 504 closing_(false),
506 host_closing_(false), 505 host_closing_(false),
507 is_swapped_out_(swapped_out), 506 is_swapped_out_(swapped_out),
508 for_oopif_(false), 507 for_oopif_(false),
509 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 508 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 if (webwidget_) 1285 if (webwidget_)
1287 webwidget_->setCursorVisibilityState(is_visible); 1286 webwidget_->setCursorVisibilityState(is_visible);
1288 } 1287 }
1289 1288
1290 void RenderWidget::OnMouseCaptureLost() { 1289 void RenderWidget::OnMouseCaptureLost() {
1291 if (webwidget_) 1290 if (webwidget_)
1292 webwidget_->mouseCaptureLost(); 1291 webwidget_->mouseCaptureLost();
1293 } 1292 }
1294 1293
1295 void RenderWidget::OnSetFocus(bool enable) { 1294 void RenderWidget::OnSetFocus(bool enable) {
1296 has_focus_ = enable;
1297
1298 // TODO(nasko): This code is here to help diagnose https://crbug.com/541578. 1295 // TODO(nasko): This code is here to help diagnose https://crbug.com/541578.
1299 if (webwidget_->isWebView()) { 1296 if (webwidget_->isWebView()) {
1300 blink::WebView* view = static_cast<blink::WebView*>(webwidget_); 1297 blink::WebView* view = static_cast<blink::WebView*>(webwidget_);
1301 if (view->mainFrame()->isWebRemoteFrame()) { 1298 if (view->mainFrame()->isWebRemoteFrame()) {
1302 blink::WebFrame* mainFrame = view->mainFrame(); 1299 blink::WebFrame* mainFrame = view->mainFrame();
1303 1300
1304 base::debug::Alias(&mainFrame); 1301 base::debug::Alias(&mainFrame);
1305 base::debug::Alias(&is_swapped_out_); 1302 base::debug::Alias(&is_swapped_out_);
1306 1303
1307 base::debug::DumpWithoutCrashing(); 1304 base::debug::DumpWithoutCrashing();
1308 } 1305 }
1309 } 1306 }
1310 1307
1311 if (webwidget_) 1308 if (webwidget_)
1312 webwidget_->setFocus(enable); 1309 webwidget_->setFocus(enable);
Charlie Reis 2015/10/14 19:32:52 Daniel/Ken, can I get a sanity check here? conten
alexmos 2015/10/14 20:12:33 Yes, it'd be good to have Daniel or Ken double-che
kenrb 2015/10/15 18:57:30 It looks like setFocus() could move from from WebW
alexmos 2015/10/15 20:29:30 I think this would be good to do. It seems that W
kenrb 2015/10/16 20:38:16 That's a good point, and probably a reason to leav
1313 } 1310 }
1314 1311
1315 void RenderWidget::FlushPendingInputEventAck() { 1312 void RenderWidget::FlushPendingInputEventAck() {
1316 if (pending_input_event_ack_) { 1313 if (pending_input_event_ack_) {
1317 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", 1314 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck",
1318 pending_input_event_ack_.get()); 1315 pending_input_event_ack_.get());
1319 Send(pending_input_event_ack_.release()); 1316 Send(pending_input_event_ack_.release());
1320 } 1317 }
1321 total_input_handling_time_this_frame_ = base::TimeDelta(); 1318 total_input_handling_time_this_frame_ = base::TimeDelta();
1322 } 1319 }
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2397 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2401 video_hole_frames_.AddObserver(frame); 2398 video_hole_frames_.AddObserver(frame);
2402 } 2399 }
2403 2400
2404 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2401 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2405 video_hole_frames_.RemoveObserver(frame); 2402 video_hole_frames_.RemoveObserver(frame);
2406 } 2403 }
2407 #endif // defined(VIDEO_HOLE) 2404 #endif // defined(VIDEO_HOLE)
2408 2405
2409 } // namespace content 2406 } // namespace content
OLDNEW
« content/renderer/render_view_impl.h ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698