| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "blimp/client/public/contents/blimp_contents_observer.h" |
| 6 |
| 7 #include "blimp/client/public/contents/blimp_contents.h" |
| 8 |
| 9 namespace blimp { |
| 10 namespace client { |
| 11 |
| 12 BlimpContentsObserver::BlimpContentsObserver(BlimpContents* blimp_contents) |
| 13 : contents_(blimp_contents) { |
| 14 blimp_contents->AddObserver(this); |
| 15 } |
| 16 |
| 17 BlimpContentsObserver::~BlimpContentsObserver() { |
| 18 if (contents_) |
| 19 contents_->RemoveObserver(this); |
| 20 } |
| 21 |
| 22 void BlimpContentsObserver::BlimpContentsDying() { |
| 23 DCHECK(contents_); |
| 24 OnContentsDestroyed(); |
| 25 contents_ = nullptr; |
| 26 } |
| 27 |
| 28 } // namespace client |
| 29 } // namespace blimp |
| OLD | NEW |