OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/guest_view_base.h" | 5 #include "extensions/browser/guest_view/guest_view_base.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/ui/zoom/page_zoom.h" | 9 #include "components/ui/zoom/page_zoom.h" |
10 #include "components/ui/zoom/zoom_controller.h" | 10 #include "components/ui/zoom/zoom_controller.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 const gfx::Size& new_size) { | 236 const gfx::Size& new_size) { |
237 if (new_size == old_size) | 237 if (new_size == old_size) |
238 return; | 238 return; |
239 | 239 |
240 // Dispatch the onResize event. | 240 // Dispatch the onResize event. |
241 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 241 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
242 args->SetInteger(guestview::kOldWidth, old_size.width()); | 242 args->SetInteger(guestview::kOldWidth, old_size.width()); |
243 args->SetInteger(guestview::kOldHeight, old_size.height()); | 243 args->SetInteger(guestview::kOldHeight, old_size.height()); |
244 args->SetInteger(guestview::kNewWidth, new_size.width()); | 244 args->SetInteger(guestview::kNewWidth, new_size.width()); |
245 args->SetInteger(guestview::kNewHeight, new_size.height()); | 245 args->SetInteger(guestview::kNewHeight, new_size.height()); |
246 scoped_ptr<base::DictionaryValue> args_copy(args.get()->DeepCopy()); | |
246 DispatchEventToGuestProxy(new Event(guestview::kEventResize, args.Pass())); | 247 DispatchEventToGuestProxy(new Event(guestview::kEventResize, args.Pass())); |
248 DispatchEventToView( | |
249 new Event(guestview::kEventContentResize, args_copy.Pass())); | |
Fady Samuel
2015/03/05 20:24:55
I'm confused about this. Why are you dispatching t
paulmeyer
2015/03/05 20:30:36
One goes to the guest, and one to the container, s
paulmeyer
2015/03/06 18:31:02
After talking about this offline, I have removed t
| |
247 } | 250 } |
248 | 251 |
249 void GuestViewBase::SetSize(const SetSizeParams& params) { | 252 void GuestViewBase::SetSize(const SetSizeParams& params) { |
250 bool enable_auto_size = | 253 bool enable_auto_size = |
251 params.enable_auto_size ? *params.enable_auto_size : auto_size_enabled_; | 254 params.enable_auto_size ? *params.enable_auto_size : auto_size_enabled_; |
252 gfx::Size min_size = params.min_size ? *params.min_size : min_auto_size_; | 255 gfx::Size min_size = params.min_size ? *params.min_size : min_auto_size_; |
253 gfx::Size max_size = params.max_size ? *params.max_size : max_auto_size_; | 256 gfx::Size max_size = params.max_size ? *params.max_size : max_auto_size_; |
254 | 257 |
255 if (params.normal_size) | 258 if (params.normal_size) |
256 normal_size_ = *params.normal_size; | 259 normal_size_ = *params.normal_size; |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
813 void GuestViewBase::RegisterGuestViewTypes() { | 816 void GuestViewBase::RegisterGuestViewTypes() { |
814 AppViewGuest::Register(); | 817 AppViewGuest::Register(); |
815 ExtensionOptionsGuest::Register(); | 818 ExtensionOptionsGuest::Register(); |
816 ExtensionViewGuest::Register(); | 819 ExtensionViewGuest::Register(); |
817 MimeHandlerViewGuest::Register(); | 820 MimeHandlerViewGuest::Register(); |
818 SurfaceWorkerGuest::Register(); | 821 SurfaceWorkerGuest::Register(); |
819 WebViewGuest::Register(); | 822 WebViewGuest::Register(); |
820 } | 823 } |
821 | 824 |
822 } // namespace extensions | 825 } // namespace extensions |
OLD | NEW |