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

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

Issue 1815593002: Remove windowed NPAPI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make_test_plugin_windowless
Patch Set: rebase Created 4 years, 9 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/shell/tools/plugin/main.cpp » ('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) 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 <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 818
819 void RenderWidget::DidCompletePageScaleAnimation() {} 819 void RenderWidget::DidCompletePageScaleAnimation() {}
820 820
821 void RenderWidget::DidCompleteSwapBuffers() { 821 void RenderWidget::DidCompleteSwapBuffers() {
822 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers"); 822 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers");
823 823
824 // Notify subclasses threaded composited rendering was flushed to the screen. 824 // Notify subclasses threaded composited rendering was flushed to the screen.
825 DidFlushPaint(); 825 DidFlushPaint();
826 826
827 if (!next_paint_flags_ && !need_update_rect_for_auto_resize_ && 827 if (!next_paint_flags_ && !need_update_rect_for_auto_resize_) {
828 !plugin_window_moves_.size()) {
829 return; 828 return;
830 } 829 }
831 830
832 ViewHostMsg_UpdateRect_Params params; 831 ViewHostMsg_UpdateRect_Params params;
833 params.view_size = size_; 832 params.view_size = size_;
834 params.plugin_window_moves.swap(plugin_window_moves_);
835 params.flags = next_paint_flags_; 833 params.flags = next_paint_flags_;
836 834
837 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); 835 Send(new ViewHostMsg_UpdateRect(routing_id_, params));
838 next_paint_flags_ = 0; 836 next_paint_flags_ = 0;
839 need_update_rect_for_auto_resize_ = false; 837 need_update_rect_for_auto_resize_ = false;
840 } 838 }
841 839
842 bool RenderWidget::ForOOPIF() const { 840 bool RenderWidget::ForOOPIF() const {
843 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for 841 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for
844 // OOPIF(crbug.com/471411). 842 // OOPIF(crbug.com/471411).
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 const blink::WebFloatSize& velocity) { 1999 const blink::WebFloatSize& velocity) {
2002 input_handler_->DidOverscrollFromBlink(unusedDelta, accumulatedRootOverScroll, 2000 input_handler_->DidOverscrollFromBlink(unusedDelta, accumulatedRootOverScroll,
2003 position, velocity); 2001 position, velocity);
2004 } 2002 }
2005 2003
2006 void RenderWidget::StartCompositor() { 2004 void RenderWidget::StartCompositor() {
2007 if (!is_hidden()) 2005 if (!is_hidden())
2008 compositor_->setVisible(true); 2006 compositor_->setVisible(true);
2009 } 2007 }
2010 2008
2011 void RenderWidget::SchedulePluginMove(const WebPluginGeometry& move) {
2012 size_t i = 0;
2013 for (; i < plugin_window_moves_.size(); ++i) {
2014 if (plugin_window_moves_[i].window == move.window) {
2015 if (move.rects_valid) {
2016 plugin_window_moves_[i] = move;
2017 } else {
2018 plugin_window_moves_[i].visible = move.visible;
2019 }
2020 break;
2021 }
2022 }
2023
2024 if (i == plugin_window_moves_.size())
2025 plugin_window_moves_.push_back(move);
2026 }
2027
2028 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) {
2029 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin();
2030 i != plugin_window_moves_.end(); ++i) {
2031 if (i->window == window) {
2032 plugin_window_moves_.erase(i);
2033 break;
2034 }
2035 }
2036 }
2037
2038
2039 RenderWidgetCompositor* RenderWidget::compositor() const { 2009 RenderWidgetCompositor* RenderWidget::compositor() const {
2040 return compositor_.get(); 2010 return compositor_.get();
2041 } 2011 }
2042 2012
2043 void RenderWidget::SetHandlingInputEventForTesting(bool handling_input_event) { 2013 void RenderWidget::SetHandlingInputEventForTesting(bool handling_input_event) {
2044 input_handler_->set_handling_input_event(handling_input_event); 2014 input_handler_->set_handling_input_event(handling_input_event);
2045 } 2015 }
2046 2016
2047 bool RenderWidget::SendAckForMouseMoveFromDebugger() { 2017 bool RenderWidget::SendAckForMouseMoveFromDebugger() {
2048 return input_handler_->SendAckForMouseMoveFromDebugger(); 2018 return input_handler_->SendAckForMouseMoveFromDebugger();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 } 2154 }
2185 2155
2186 float RenderWidget::GetOriginalDeviceScaleFactor() const { 2156 float RenderWidget::GetOriginalDeviceScaleFactor() const {
2187 return 2157 return
2188 screen_metrics_emulator_ ? 2158 screen_metrics_emulator_ ?
2189 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : 2159 screen_metrics_emulator_->original_screen_info().deviceScaleFactor :
2190 device_scale_factor_; 2160 device_scale_factor_;
2191 } 2161 }
2192 2162
2193 } // namespace content 2163 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/shell/tools/plugin/main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698