| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 params); | 682 params); |
| 683 } | 683 } |
| 684 | 684 |
| 685 bool GuestViewBase::ShouldFocusPageAfterCrash() { | 685 bool GuestViewBase::ShouldFocusPageAfterCrash() { |
| 686 // Focus is managed elsewhere. | 686 // Focus is managed elsewhere. |
| 687 return false; | 687 return false; |
| 688 } | 688 } |
| 689 | 689 |
| 690 bool GuestViewBase::PreHandleGestureEvent(WebContents* source, | 690 bool GuestViewBase::PreHandleGestureEvent(WebContents* source, |
| 691 const blink::WebGestureEvent& event) { | 691 const blink::WebGestureEvent& event) { |
| 692 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 692 return event.type() == blink::WebGestureEvent::GesturePinchBegin || |
| 693 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 693 event.type() == blink::WebGestureEvent::GesturePinchUpdate || |
| 694 event.type == blink::WebGestureEvent::GesturePinchEnd; | 694 event.type() == blink::WebGestureEvent::GesturePinchEnd; |
| 695 } | 695 } |
| 696 | 696 |
| 697 void GuestViewBase::UpdatePreferredSize(WebContents* target_web_contents, | 697 void GuestViewBase::UpdatePreferredSize(WebContents* target_web_contents, |
| 698 const gfx::Size& pref_size) { | 698 const gfx::Size& pref_size) { |
| 699 // In theory it's not necessary to check IsPreferredSizeModeEnabled() because | 699 // In theory it's not necessary to check IsPreferredSizeModeEnabled() because |
| 700 // there will only be events if it was enabled in the first place. However, | 700 // there will only be events if it was enabled in the first place. However, |
| 701 // something else may have turned on preferred size mode, so double check. | 701 // something else may have turned on preferred size mode, so double check. |
| 702 DCHECK_EQ(web_contents(), target_web_contents); | 702 DCHECK_EQ(web_contents(), target_web_contents); |
| 703 if (IsPreferredSizeModeEnabled()) { | 703 if (IsPreferredSizeModeEnabled()) { |
| 704 OnPreferredSizeChanged(pref_size); | 704 OnPreferredSizeChanged(pref_size); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 | 920 |
| 921 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, | 921 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, |
| 922 bool due_to_auto_resize) { | 922 bool due_to_auto_resize) { |
| 923 if (due_to_auto_resize) | 923 if (due_to_auto_resize) |
| 924 GuestSizeChangedDueToAutoSize(guest_size_, new_size); | 924 GuestSizeChangedDueToAutoSize(guest_size_, new_size); |
| 925 DispatchOnResizeEvent(guest_size_, new_size); | 925 DispatchOnResizeEvent(guest_size_, new_size); |
| 926 guest_size_ = new_size; | 926 guest_size_ = new_size; |
| 927 } | 927 } |
| 928 | 928 |
| 929 } // namespace guest_view | 929 } // namespace guest_view |
| OLD | NEW |