| OLD | NEW |
| 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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 : host_(RenderWidgetHostImpl::From(host)), | 383 : host_(RenderWidgetHostImpl::From(host)), |
| 384 window_(nullptr), | 384 window_(nullptr), |
| 385 in_shutdown_(false), | 385 in_shutdown_(false), |
| 386 in_bounds_changed_(false), | 386 in_bounds_changed_(false), |
| 387 popup_parent_host_view_(nullptr), | 387 popup_parent_host_view_(nullptr), |
| 388 popup_child_host_view_(nullptr), | 388 popup_child_host_view_(nullptr), |
| 389 is_loading_(false), | 389 is_loading_(false), |
| 390 has_composition_text_(false), | 390 has_composition_text_(false), |
| 391 background_color_(SK_ColorWHITE), | 391 background_color_(SK_ColorWHITE), |
| 392 needs_begin_frames_(false), | 392 needs_begin_frames_(false), |
| 393 needs_flush_input_(false), | |
| 394 added_frame_observer_(false), | 393 added_frame_observer_(false), |
| 395 cursor_visibility_state_in_renderer_(UNKNOWN), | 394 cursor_visibility_state_in_renderer_(UNKNOWN), |
| 396 #if defined(OS_WIN) | 395 #if defined(OS_WIN) |
| 397 legacy_render_widget_host_HWND_(nullptr), | 396 legacy_render_widget_host_HWND_(nullptr), |
| 398 legacy_window_destroyed_(false), | 397 legacy_window_destroyed_(false), |
| 399 virtual_keyboard_requested_(false), | 398 virtual_keyboard_requested_(false), |
| 400 #endif | 399 #endif |
| 401 has_snapped_to_boundary_(false), | 400 has_snapped_to_boundary_(false), |
| 402 is_guest_view_hack_(is_guest_view_hack), | 401 is_guest_view_hack_(is_guest_view_hack), |
| 403 device_scale_factor_(0.0f), | 402 device_scale_factor_(0.0f), |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 642 |
| 644 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { | 643 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { |
| 645 return this; | 644 return this; |
| 646 } | 645 } |
| 647 | 646 |
| 648 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) { | 647 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) { |
| 649 needs_begin_frames_ = needs_begin_frames; | 648 needs_begin_frames_ = needs_begin_frames; |
| 650 UpdateNeedsBeginFramesInternal(); | 649 UpdateNeedsBeginFramesInternal(); |
| 651 } | 650 } |
| 652 | 651 |
| 653 void RenderWidgetHostViewAura::OnSetNeedsFlushInput() { | |
| 654 needs_flush_input_ = true; | |
| 655 UpdateNeedsBeginFramesInternal(); | |
| 656 } | |
| 657 | |
| 658 void RenderWidgetHostViewAura::OnBeginFrame() { | 652 void RenderWidgetHostViewAura::OnBeginFrame() { |
| 659 needs_flush_input_ = false; | |
| 660 host_->OnBeginFrame(); | |
| 661 UpdateNeedsBeginFramesInternal(); | 653 UpdateNeedsBeginFramesInternal(); |
| 662 } | 654 } |
| 663 | 655 |
| 664 RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() { | 656 RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() { |
| 665 RenderViewHost* rvh = RenderViewHost::From(host_); | 657 RenderViewHost* rvh = RenderViewHost::From(host_); |
| 666 if (!rvh) | 658 if (!rvh) |
| 667 return nullptr; | 659 return nullptr; |
| 668 FrameTreeNode* focused_frame = | 660 FrameTreeNode* focused_frame = |
| 669 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); | 661 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); |
| 670 if (!focused_frame) | 662 if (!focused_frame) |
| (...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 RenderWidgetHostViewAura* popup_child_host_view) { | 2416 RenderWidgetHostViewAura* popup_child_host_view) { |
| 2425 popup_child_host_view_ = popup_child_host_view; | 2417 popup_child_host_view_ = popup_child_host_view; |
| 2426 event_handler_->SetPopupChild( | 2418 event_handler_->SetPopupChild( |
| 2427 popup_child_host_view, | 2419 popup_child_host_view, |
| 2428 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2420 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
| 2429 } | 2421 } |
| 2430 | 2422 |
| 2431 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { | 2423 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
| 2432 if (!delegated_frame_host_) | 2424 if (!delegated_frame_host_) |
| 2433 return; | 2425 return; |
| 2434 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || | 2426 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_); |
| 2435 needs_flush_input_); | |
| 2436 } | 2427 } |
| 2437 | 2428 |
| 2438 } // namespace content | 2429 } // namespace content |
| OLD | NEW |