| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 delegated_frame_host_(new DelegatedFrameHost(this)), | 433 delegated_frame_host_(new DelegatedFrameHost(this)), |
| 434 in_shutdown_(false), | 434 in_shutdown_(false), |
| 435 in_bounds_changed_(false), | 435 in_bounds_changed_(false), |
| 436 is_fullscreen_(false), | 436 is_fullscreen_(false), |
| 437 popup_parent_host_view_(nullptr), | 437 popup_parent_host_view_(nullptr), |
| 438 popup_child_host_view_(nullptr), | 438 popup_child_host_view_(nullptr), |
| 439 is_loading_(false), | 439 is_loading_(false), |
| 440 has_composition_text_(false), | 440 has_composition_text_(false), |
| 441 accept_return_character_(false), | 441 accept_return_character_(false), |
| 442 begin_frame_source_(nullptr), | 442 begin_frame_source_(nullptr), |
| 443 needs_begin_frames_(false), |
| 444 needs_flush_input_(false), |
| 445 added_frame_observer_(false), |
| 443 synthetic_move_sent_(false), | 446 synthetic_move_sent_(false), |
| 444 cursor_visibility_state_in_renderer_(UNKNOWN), | 447 cursor_visibility_state_in_renderer_(UNKNOWN), |
| 445 #if defined(OS_WIN) | 448 #if defined(OS_WIN) |
| 446 legacy_render_widget_host_HWND_(nullptr), | 449 legacy_render_widget_host_HWND_(nullptr), |
| 447 legacy_window_destroyed_(false), | 450 legacy_window_destroyed_(false), |
| 448 virtual_keyboard_requested_(false), | 451 virtual_keyboard_requested_(false), |
| 449 #endif | 452 #endif |
| 450 has_snapped_to_boundary_(false), | 453 has_snapped_to_boundary_(false), |
| 451 is_guest_view_hack_(is_guest_view_hack), | 454 is_guest_view_hack_(is_guest_view_hack), |
| 452 set_focus_on_mouse_down_or_key_event_(false), | 455 set_focus_on_mouse_down_or_key_event_(false), |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 708 |
| 706 NOTIMPLEMENTED(); | 709 NOTIMPLEMENTED(); |
| 707 return static_cast<gfx::NativeViewAccessible>(NULL); | 710 return static_cast<gfx::NativeViewAccessible>(NULL); |
| 708 } | 711 } |
| 709 | 712 |
| 710 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { | 713 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { |
| 711 return this; | 714 return this; |
| 712 } | 715 } |
| 713 | 716 |
| 714 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) { | 717 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) { |
| 718 needs_begin_frames_ = needs_begin_frames; |
| 719 UpdateNeedsBeginFramesInternal(); |
| 720 } |
| 721 |
| 722 void RenderWidgetHostViewAura::OnSetNeedsFlushInput() { |
| 723 needs_flush_input_ = true; |
| 724 UpdateNeedsBeginFramesInternal(); |
| 725 } |
| 726 |
| 727 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
| 715 if (!begin_frame_source_) | 728 if (!begin_frame_source_) |
| 716 return; | 729 return; |
| 717 | 730 |
| 718 if (needs_begin_frames) | 731 bool needs_frame = needs_begin_frames_ || needs_flush_input_; |
| 732 if (needs_frame == added_frame_observer_) |
| 733 return; |
| 734 |
| 735 added_frame_observer_ = needs_frame; |
| 736 if (needs_frame) |
| 719 begin_frame_source_->AddObserver(this); | 737 begin_frame_source_->AddObserver(this); |
| 720 else | 738 else |
| 721 begin_frame_source_->RemoveObserver(this); | 739 begin_frame_source_->RemoveObserver(this); |
| 722 } | 740 } |
| 723 | 741 |
| 724 void RenderWidgetHostViewAura::OnBeginFrame( | 742 void RenderWidgetHostViewAura::OnBeginFrame( |
| 725 const cc::BeginFrameArgs& args) { | 743 const cc::BeginFrameArgs& args) { |
| 744 needs_flush_input_ = false; |
| 745 host_->FlushInput(); |
| 746 UpdateNeedsBeginFramesInternal(); |
| 726 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args)); | 747 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args)); |
| 727 last_begin_frame_args_ = args; | 748 last_begin_frame_args_ = args; |
| 728 } | 749 } |
| 729 | 750 |
| 730 const cc::BeginFrameArgs& RenderWidgetHostViewAura::LastUsedBeginFrameArgs() | 751 const cc::BeginFrameArgs& RenderWidgetHostViewAura::LastUsedBeginFrameArgs() |
| 731 const { | 752 const { |
| 732 return last_begin_frame_args_; | 753 return last_begin_frame_args_; |
| 733 } | 754 } |
| 734 | 755 |
| 735 void RenderWidgetHostViewAura::OnBeginFrameSourcePausedChanged(bool paused) { | 756 void RenderWidgetHostViewAura::OnBeginFrameSourcePausedChanged(bool paused) { |
| (...skipping 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3042 ->GetTextSelection(focused_view) | 3063 ->GetTextSelection(focused_view) |
| 3043 ->GetSelectedText(&selected_text)) { | 3064 ->GetSelectedText(&selected_text)) { |
| 3044 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3065 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3045 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3066 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3046 clipboard_writer.WriteText(selected_text); | 3067 clipboard_writer.WriteText(selected_text); |
| 3047 } | 3068 } |
| 3048 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3069 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3049 } | 3070 } |
| 3050 | 3071 |
| 3051 } // namespace content | 3072 } // namespace content |
| OLD | NEW |