 Chromium Code Reviews
 Chromium Code Reviews Issue 1711103002:
  Implement lifetime observer on RenderWidgetHostViewBase.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1711103002:
  Implement lifetime observer on RenderWidgetHostViewBase.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 
| 6 | 6 | 
| 7 #include <set> | 7 #include <set> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" | 
| (...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2479 TRACE_EVENT1("ui", "RenderWidgetHostViewAura::OnHostMoved", | 2479 TRACE_EVENT1("ui", "RenderWidgetHostViewAura::OnHostMoved", | 
| 2480 "new_origin", new_origin.ToString()); | 2480 "new_origin", new_origin.ToString()); | 
| 2481 | 2481 | 
| 2482 UpdateScreenInfo(window_); | 2482 UpdateScreenInfo(window_); | 
| 2483 } | 2483 } | 
| 2484 | 2484 | 
| 2485 //////////////////////////////////////////////////////////////////////////////// | 2485 //////////////////////////////////////////////////////////////////////////////// | 
| 2486 // RenderWidgetHostViewAura, private: | 2486 // RenderWidgetHostViewAura, private: | 
| 2487 | 2487 | 
| 2488 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { | 2488 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { | 
| 2489 // If the observers were already notified through the Destroy() pathway, then | |
| 2490 // this next call just returns. | |
| 
kenrb
2016/02/22 17:05:10
Is this comment necessary? RWHVA::Destroy() doesn'
 
wjmaclean
2016/02/23 13:13:26
Done.
Ooops, slightly stale comment, removed. Act
 | |
| 2491 NotifyObserversAboutShutdown(); | |
| 2492 | |
| 2489 // Ask the RWH to drop reference to us. | 2493 // Ask the RWH to drop reference to us. | 
| 2490 if (!is_guest_view_hack_) | 2494 if (!is_guest_view_hack_) | 
| 2491 host_->ViewDestroyed(); | 2495 host_->ViewDestroyed(); | 
| 2492 | 2496 | 
| 2493 selection_controller_.reset(); | 2497 selection_controller_.reset(); | 
| 2494 selection_controller_client_.reset(); | 2498 selection_controller_client_.reset(); | 
| 2495 | 2499 | 
| 2496 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { | |
| 2497 host_->delegate()->GetInputEventRouter()->RemoveSurfaceIdNamespaceOwner( | |
| 2498 GetSurfaceIdNamespace()); | |
| 2499 } | |
| 2500 delegated_frame_host_.reset(); | 2500 delegated_frame_host_.reset(); | 
| 2501 window_observer_.reset(); | 2501 window_observer_.reset(); | 
| 2502 if (window_) { | 2502 if (window_) { | 
| 2503 if (window_->GetHost()) | 2503 if (window_->GetHost()) | 
| 2504 window_->GetHost()->RemoveObserver(this); | 2504 window_->GetHost()->RemoveObserver(this); | 
| 2505 UnlockMouse(); | 2505 UnlockMouse(); | 
| 2506 aura::client::SetTooltipText(window_, NULL); | 2506 aura::client::SetTooltipText(window_, NULL); | 
| 2507 gfx::Screen::GetScreen()->RemoveObserver(this); | 2507 gfx::Screen::GetScreen()->RemoveObserver(this); | 
| 2508 | 2508 | 
| 2509 // This call is usually no-op since |this| object is already removed from | 2509 // This call is usually no-op since |this| object is already removed from | 
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3065 | 3065 | 
| 3066 //////////////////////////////////////////////////////////////////////////////// | 3066 //////////////////////////////////////////////////////////////////////////////// | 
| 3067 // RenderWidgetHostViewBase, public: | 3067 // RenderWidgetHostViewBase, public: | 
| 3068 | 3068 | 
| 3069 // static | 3069 // static | 
| 3070 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 3070 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 
| 3071 GetScreenInfoForWindow(results, NULL); | 3071 GetScreenInfoForWindow(results, NULL); | 
| 3072 } | 3072 } | 
| 3073 | 3073 | 
| 3074 } // namespace content | 3074 } // namespace content | 
| OLD | NEW |