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 "components/guest_view/browser/guest_view_base.h" | 5 #include "components/guest_view/browser/guest_view_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 while (GuestViewBase* guest = FromWebContents(web_contents)) | 371 while (GuestViewBase* guest = FromWebContents(web_contents)) |
372 web_contents = guest->owner_web_contents(); | 372 web_contents = guest->owner_web_contents(); |
373 return web_contents; | 373 return web_contents; |
374 } | 374 } |
375 | 375 |
376 // static | 376 // static |
377 bool GuestViewBase::IsGuest(WebContents* web_contents) { | 377 bool GuestViewBase::IsGuest(WebContents* web_contents) { |
378 return !!GuestViewBase::FromWebContents(web_contents); | 378 return !!GuestViewBase::FromWebContents(web_contents); |
379 } | 379 } |
380 | 380 |
| 381 bool GuestViewBase::IsForMimeHandlerViewGuest(WebContents* web_contents) { |
| 382 GuestViewBase* guest_view_base = GuestViewBase::FromWebContents(web_contents); |
| 383 return !!guest_view_base && guest_view_base->IsMimeHandlerViewGuest(); |
| 384 } |
| 385 |
381 bool GuestViewBase::IsAutoSizeSupported() const { | 386 bool GuestViewBase::IsAutoSizeSupported() const { |
382 return false; | 387 return false; |
383 } | 388 } |
384 | 389 |
385 bool GuestViewBase::IsPreferredSizeModeEnabled() const { | 390 bool GuestViewBase::IsPreferredSizeModeEnabled() const { |
386 return false; | 391 return false; |
387 } | 392 } |
388 | 393 |
389 bool GuestViewBase::ZoomPropagatesFromEmbedderToGuest() const { | 394 bool GuestViewBase::ZoomPropagatesFromEmbedderToGuest() const { |
390 return true; | 395 return true; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 890 |
886 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, | 891 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, |
887 bool due_to_auto_resize) { | 892 bool due_to_auto_resize) { |
888 if (due_to_auto_resize) | 893 if (due_to_auto_resize) |
889 GuestSizeChangedDueToAutoSize(guest_size_, new_size); | 894 GuestSizeChangedDueToAutoSize(guest_size_, new_size); |
890 DispatchOnResizeEvent(guest_size_, new_size); | 895 DispatchOnResizeEvent(guest_size_, new_size); |
891 guest_size_ = new_size; | 896 guest_size_ = new_size; |
892 } | 897 } |
893 | 898 |
894 } // namespace guest_view | 899 } // namespace guest_view |
OLD | NEW |