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

Side by Side Diff: trunk/src/content/browser/browser_plugin/browser_plugin_guest.cc

Issue 23833005: Revert 221023 "Reland after fix: Improve <webview> autosize:" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) { 1392 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) {
1393 bool old_auto_size_enabled = auto_size_enabled_; 1393 bool old_auto_size_enabled = auto_size_enabled_;
1394 gfx::Size old_max_size = max_auto_size_; 1394 gfx::Size old_max_size = max_auto_size_;
1395 gfx::Size old_min_size = min_auto_size_; 1395 gfx::Size old_min_size = min_auto_size_;
1396 auto_size_enabled_ = auto_size_params.enable; 1396 auto_size_enabled_ = auto_size_params.enable;
1397 max_auto_size_ = auto_size_params.max_size; 1397 max_auto_size_ = auto_size_params.max_size;
1398 min_auto_size_ = auto_size_params.min_size; 1398 min_auto_size_ = auto_size_params.min_size;
1399 if (auto_size_enabled_ && (!old_auto_size_enabled || 1399 if (auto_size_enabled_ && (!old_auto_size_enabled ||
1400 (old_max_size != max_auto_size_) || 1400 (old_max_size != max_auto_size_) ||
1401 (old_min_size != min_auto_size_))) { 1401 (old_min_size != min_auto_size_))) {
1402 RecordAction(UserMetricsAction("BrowserPlugin.Guest.EnableAutoResize"));
1403 GetWebContents()->GetRenderViewHost()->EnableAutoResize( 1402 GetWebContents()->GetRenderViewHost()->EnableAutoResize(
1404 min_auto_size_, max_auto_size_); 1403 min_auto_size_, max_auto_size_);
1405 // TODO(fsamuel): If we're changing autosize parameters, then we force 1404 // TODO(fsamuel): If we're changing autosize parameters, then we force
1406 // the guest to completely repaint itself, because BrowserPlugin has 1405 // the guest to completely repaint itself, because BrowserPlugin has
1407 // allocated a new damage buffer and expects a full frame of pixels. 1406 // allocated a new damage buffer and expects a full frame of pixels.
1408 // Ideally, we shouldn't need to do this because we shouldn't need to 1407 // Ideally, we shouldn't need to do this because we shouldn't need to
1409 // allocate a new damage buffer unless |max_auto_size_| has changed. 1408 // allocate a new damage buffer unless |max_auto_size_| has changed.
1410 // However, even in that case, layout may not change and so we may 1409 // However, even in that case, layout may not change and so we may
1411 // not get a full frame worth of pixels. 1410 // not get a full frame worth of pixels.
1412 Send(new ViewMsg_Repaint(routing_id(), max_auto_size_)); 1411 Send(new ViewMsg_Repaint(routing_id(), max_auto_size_));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 request_info.Set(browser_plugin::kRequestMethod, 1686 request_info.Set(browser_plugin::kRequestMethod,
1688 base::Value::CreateStringValue(request_method)); 1687 base::Value::CreateStringValue(request_method));
1689 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); 1688 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url));
1690 1689
1691 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, 1690 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD,
1692 new DownloadRequest(callback), 1691 new DownloadRequest(callback),
1693 request_info); 1692 request_info);
1694 } 1693 }
1695 1694
1696 } // namespace content 1695 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698