Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Side by Side Diff: blimp/client/public/contents/blimp_contents_observer.cc

Issue 2201433002: Migrate TabControlFeature from 0.5 to 0.6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address all of tommy's comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.h"
6 #include "blimp/client/public/contents/blimp_contents_observer.h"
7
8 namespace blimp {
9 namespace client {
10
11 BlimpContentsObserver::BlimpContentsObserver(BlimpContents* blimp_contents)
12 : contents_(blimp_contents) {
13 blimp_contents->AddObserver(this);
14 }
15
16 BlimpContentsObserver::~BlimpContentsObserver() {
David Trainor- moved to gerrit 2016/08/06 04:32:58 Can we have two unit tests for this? 1. When this
Menglin 2016/08/09 00:31:18 Done.
17 if (contents_)
18 contents_->RemoveObserver(this);
19 }
20
21 void BlimpContentsObserver::OnContentsDestroyed() {
22 DCHECK(contents_);
23 ClearBlimpContents();
24 }
25
26 void BlimpContentsObserver::ClearBlimpContents() {
27 contents_ = nullptr;
28 }
29
30 } // namespace client
31 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698