summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api/guest_view
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2015-01-13 17:00:04 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-14 01:03:00 +0000
commit78a50272ee606506c156aa4b34f4f03c5a4f654a (patch)
tree6a1adc7e250832dc816ab6e6e7701bcad9771615 /extensions/browser/api/guest_view
parent9cf3c6f4c0a79991a5ebacebee62adb0fb267861 (diff)
downloadchromium_src-78a50272ee606506c156aa4b34f4f03c5a4f654a.zip
chromium_src-78a50272ee606506c156aa4b34f4f03c5a4f654a.tar.gz
chromium_src-78a50272ee606506c156aa4b34f4f03c5a4f654a.tar.bz2
Revert of Implemented explicit resizing from guestview. (patchset #6 id:120001 of https://codereview.chromium.org/847893002/)
Reason for revert: Broke out of process PDF. Original issue's description: > Implemented explicit resizing from guestview. > > A guest can now be explicitly resized (in addition to autosizing) from guest_view.js, using the new |setSize| function. This new function combines autosizing and normal resizing, as described in: https://docs.google.com/document/d/1EJfmJSK0JJsxKptSRhepnsOOwvXJNv5nnJ1pZdjGDRQ > > BUG=434226 > > Committed: https://crrev.com/681a4fc1d1ac77a17c69ba23fa6710a0e3aa206f > Cr-Commit-Position: refs/heads/master@{#311286} TBR=paulmeyer@chromium.org NOTREECHECKS=true NOTRY=true BUG=434226 Review URL: https://codereview.chromium.org/800543005 Cr-Commit-Position: refs/heads/master@{#311379}
Diffstat (limited to 'extensions/browser/api/guest_view')
-rw-r--r--extensions/browser/api/guest_view/guest_view_internal_api.cc37
-rw-r--r--extensions/browser/api/guest_view/guest_view_internal_api.h10
2 files changed, 17 insertions, 30 deletions
diff --git a/extensions/browser/api/guest_view/guest_view_internal_api.cc b/extensions/browser/api/guest_view/guest_view_internal_api.cc
index 9e1efe5..fa4201e 100644
--- a/extensions/browser/api/guest_view/guest_view_internal_api.cc
+++ b/extensions/browser/api/guest_view/guest_view_internal_api.cc
@@ -79,40 +79,27 @@ bool GuestViewInternalDestroyGuestFunction::RunAsync() {
return true;
}
-GuestViewInternalSetSizeFunction::GuestViewInternalSetSizeFunction() {
+GuestViewInternalSetAutoSizeFunction::
+ GuestViewInternalSetAutoSizeFunction() {
}
-GuestViewInternalSetSizeFunction::~GuestViewInternalSetSizeFunction() {
+GuestViewInternalSetAutoSizeFunction::
+ ~GuestViewInternalSetAutoSizeFunction() {
}
-bool GuestViewInternalSetSizeFunction::RunAsync() {
- scoped_ptr<guest_view_internal::SetSize::Params> params(
- guest_view_internal::SetSize::Params::Create(*args_));
+bool GuestViewInternalSetAutoSizeFunction::RunAsync() {
+ scoped_ptr<guest_view_internal::SetAutoSize::Params> params(
+ guest_view_internal::SetAutoSize::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
GuestViewBase* guest = GuestViewBase::From(
render_view_host()->GetProcess()->GetID(), params->instance_id);
if (!guest)
return false;
-
- SetSizeParams set_size_params;
- if (params->params.enable_auto_size) {
- set_size_params.enable_auto_size.reset(
- params->params.enable_auto_size.release());
- }
- if (params->params.min) {
- set_size_params.min_size.reset(
- new gfx::Size(params->params.min->width, params->params.min->height));
- }
- if (params->params.max) {
- set_size_params.max_size.reset(
- new gfx::Size(params->params.max->width, params->params.max->height));
- }
- if (params->params.normal) {
- set_size_params.normal_size.reset(new gfx::Size(
- params->params.normal->width, params->params.normal->height));
- }
-
- guest->SetSize(set_size_params);
+ guest->SetAutoSize(params->params.enable_auto_size,
+ gfx::Size(params->params.min.width,
+ params->params.min.height),
+ gfx::Size(params->params.max.width,
+ params->params.max.height));
SendResponse(true);
return true;
}
diff --git a/extensions/browser/api/guest_view/guest_view_internal_api.h b/extensions/browser/api/guest_view/guest_view_internal_api.h
index 3f76ab9..3f0b63e 100644
--- a/extensions/browser/api/guest_view/guest_view_internal_api.h
+++ b/extensions/browser/api/guest_view/guest_view_internal_api.h
@@ -39,19 +39,19 @@ class GuestViewInternalDestroyGuestFunction : public AsyncExtensionFunction {
DISALLOW_COPY_AND_ASSIGN(GuestViewInternalDestroyGuestFunction);
};
-class GuestViewInternalSetSizeFunction : public AsyncExtensionFunction {
+class GuestViewInternalSetAutoSizeFunction : public AsyncExtensionFunction {
public:
- DECLARE_EXTENSION_FUNCTION("guestViewInternal.setSize",
+ DECLARE_EXTENSION_FUNCTION("guestViewInternal.setAutoSize",
GUESTVIEWINTERNAL_SETAUTOSIZE);
- GuestViewInternalSetSizeFunction();
+ GuestViewInternalSetAutoSizeFunction();
protected:
- ~GuestViewInternalSetSizeFunction() override;
+ ~GuestViewInternalSetAutoSizeFunction() override;
bool RunAsync() final;
private:
- DISALLOW_COPY_AND_ASSIGN(GuestViewInternalSetSizeFunction);
+ DISALLOW_COPY_AND_ASSIGN(GuestViewInternalSetAutoSizeFunction);
};
} // namespace extensions