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

Side by Side Diff: components/plugins/renderer/webview_plugin.cc

Issue 1124173008: Plugin Power Saver: Unthrottle dynamically sized plugins correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/plugins/renderer/webview_plugin.h" 5 #include "components/plugins/renderer/webview_plugin.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "content/public/common/web_preferences.h" 10 #include "content/public/common/web_preferences.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 void WebViewPlugin::updateGeometry(const WebRect& window_rect, 164 void WebViewPlugin::updateGeometry(const WebRect& window_rect,
165 const WebRect& clip_rect, 165 const WebRect& clip_rect,
166 const WebRect& unobscured_rect, 166 const WebRect& unobscured_rect,
167 const WebVector<WebRect>& cut_outs_rects, 167 const WebVector<WebRect>& cut_outs_rects,
168 bool is_visible) { 168 bool is_visible) {
169 if (static_cast<gfx::Rect>(window_rect) != rect_) { 169 if (static_cast<gfx::Rect>(window_rect) != rect_) {
170 rect_ = window_rect; 170 rect_ = window_rect;
171 WebSize newSize(window_rect.width, window_rect.height); 171 WebSize newSize(window_rect.width, window_rect.height);
172 web_view_->resize(newSize); 172 web_view_->resize(newSize);
173 } 173 }
174
175 if (delegate_)
176 delegate_->OnUnobscuredSizeUpdate(gfx::Rect(unobscured_rect).size());
174 } 177 }
175 178
176 void WebViewPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) { 179 void WebViewPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) {
177 focused_ = focused; 180 focused_ = focused;
178 } 181 }
179 182
180 bool WebViewPlugin::acceptsInputEvents() { return true; } 183 bool WebViewPlugin::acceptsInputEvents() { return true; }
181 184
182 bool WebViewPlugin::handleInputEvent(const WebInputEvent& event, 185 bool WebViewPlugin::handleInputEvent(const WebInputEvent& event,
183 WebCursorInfo& cursor) { 186 WebCursorInfo& cursor) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { 266 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) {
264 if (delegate_) 267 if (delegate_)
265 delegate_->BindWebFrame(frame); 268 delegate_->BindWebFrame(frame);
266 } 269 }
267 270
268 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, 271 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame,
269 unsigned identifier, 272 unsigned identifier,
270 const WebURLResponse& response) { 273 const WebURLResponse& response) {
271 WebFrameClient::didReceiveResponse(frame, identifier, response); 274 WebFrameClient::didReceiveResponse(frame, identifier, response);
272 } 275 }
OLDNEW
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | content/public/renderer/plugin_instance_throttler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698