Chromium Code Reviews| Index: blimp/client/public/contents/blimp_contents_observer.h |
| diff --git a/blimp/client/public/contents/blimp_contents_observer.h b/blimp/client/public/contents/blimp_contents_observer.h |
| index dc3e1ec892ab03b6ee1fe4453337a05608e487b9..a567aa225daa0c5f75ccb8d33567e6311df465f8 100644 |
| --- a/blimp/client/public/contents/blimp_contents_observer.h |
| +++ b/blimp/client/public/contents/blimp_contents_observer.h |
| @@ -11,19 +11,33 @@ |
| namespace blimp { |
| namespace client { |
| +class BlimpContents; |
| + |
| // An observer API implemented by classes which are interested in various events |
| // related to BlimpContents. |
| class BlimpContentsObserver { |
| public: |
| - virtual ~BlimpContentsObserver() = default; |
| + virtual ~BlimpContentsObserver(); |
| // Invoked when the navigation state of the BlimpContents has changed. |
| virtual void OnNavigationStateChanged() {} |
| + // Invoke when the destructor of blimp contents is called. This will clear |
| + // the contents_ to nullptr. |
| + virtual void BlimpContentsDying(); |
|
David Trainor- moved to gerrit
2016/08/09 05:34:12
Don't make this virtual and put it at the end of t
Menglin
2016/08/09 18:19:31
Right. I think i somehow added virtual when i was
|
| + |
| + // Called by BlimpContentsDying(). |
| + virtual void OnContentsDestroyed() {} |
| + |
| + BlimpContents* blimp_contents() { return contents_; } |
| + |
| protected: |
| - BlimpContentsObserver() {} |
| + explicit BlimpContentsObserver(BlimpContents* blimp_contents); |
| private: |
| + // The BlimpContents being tracked by this BlimpContentsObserver. |
| + BlimpContents* contents_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(BlimpContentsObserver); |
| }; |