| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  471     return; |  471     return; | 
|  472  |  472  | 
|  473   is_being_destroyed_ = true; |  473   is_being_destroyed_ = true; | 
|  474  |  474  | 
|  475   // It is important to clear owner_web_contents_ after the call to |  475   // It is important to clear owner_web_contents_ after the call to | 
|  476   // StopTrackingEmbedderZoomLevel(), but before the rest of |  476   // StopTrackingEmbedderZoomLevel(), but before the rest of | 
|  477   // the statements in this function. |  477   // the statements in this function. | 
|  478   StopTrackingEmbedderZoomLevel(); |  478   StopTrackingEmbedderZoomLevel(); | 
|  479   owner_web_contents_ = nullptr; |  479   owner_web_contents_ = nullptr; | 
|  480  |  480  | 
 |  481   element_instance_id_ = kInstanceIDNone; | 
 |  482  | 
|  481   DCHECK(web_contents()); |  483   DCHECK(web_contents()); | 
|  482  |  484  | 
|  483   // Give the derived class an opportunity to perform some cleanup. |  485   // Give the derived class an opportunity to perform some cleanup. | 
|  484   WillDestroy(); |  486   WillDestroy(); | 
|  485  |  487  | 
|  486   // Invalidate weak pointers now so that bound callbacks cannot be called late |  488   // Invalidate weak pointers now so that bound callbacks cannot be called late | 
|  487   // into destruction. We must call this after WillDestroy because derived types |  489   // into destruction. We must call this after WillDestroy because derived types | 
|  488   // may wish to access their openers. |  490   // may wish to access their openers. | 
|  489   weak_ptr_factory_.InvalidateWeakPtrs(); |  491   weak_ptr_factory_.InvalidateWeakPtrs(); | 
|  490  |  492  | 
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  885  |  887  | 
|  886 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, |  888 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, | 
|  887                                     bool due_to_auto_resize) { |  889                                     bool due_to_auto_resize) { | 
|  888   if (due_to_auto_resize) |  890   if (due_to_auto_resize) | 
|  889     GuestSizeChangedDueToAutoSize(guest_size_, new_size); |  891     GuestSizeChangedDueToAutoSize(guest_size_, new_size); | 
|  890   DispatchOnResizeEvent(guest_size_, new_size); |  892   DispatchOnResizeEvent(guest_size_, new_size); | 
|  891   guest_size_ = new_size; |  893   guest_size_ = new_size; | 
|  892 } |  894 } | 
|  893  |  895  | 
|  894 }  // namespace guest_view |  896 }  // namespace guest_view | 
| OLD | NEW |