Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "blimp/client/core/contents/blimp_contents_impl.h" | 5 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
| 9 #include "blimp/client/public/contents/blimp_contents_observer.h" | 9 #include "blimp/client/public/contents/blimp_contents_observer.h" |
| 10 | 10 |
| 11 #if defined(OS_ANDROID) | 11 #if defined(OS_ANDROID) |
| 12 #include "blimp/client/core/contents/android/blimp_contents_impl_android.h" | 12 #include "blimp/client/core/contents/android/blimp_contents_impl_android.h" |
| 13 #endif // OS_ANDROID | 13 #endif // OS_ANDROID |
| 14 | 14 |
| 15 namespace blimp { | 15 namespace blimp { |
| 16 namespace client { | 16 namespace client { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
| 21 const char kBlimpContentsImplAndroidKey[] = "blimp_contents_impl_android"; | 21 const char kBlimpContentsImplAndroidKey[] = "blimp_contents_impl_android"; |
| 22 #endif // OS_ANDROID | 22 #endif // OS_ANDROID |
| 23 } | 23 } |
| 24 | 24 |
| 25 BlimpContentsImpl::BlimpContentsImpl() : navigation_controller_(this) {} | 25 BlimpContentsImpl::BlimpContentsImpl() : navigation_controller_(this) {} |
|
David Trainor- moved to gerrit
2016/08/03 18:55:42
What do we initialize id_ to in the default constr
Menglin
2016/08/03 23:49:59
Yeah we can remove the default constructor.
| |
| 26 | 26 |
| 27 BlimpContentsImpl::~BlimpContentsImpl() {} | 27 BlimpContentsImpl::BlimpContentsImpl(int id) |
| 28 : navigation_controller_(this), id_(id) {} | |
| 29 | |
| 30 BlimpContentsImpl::~BlimpContentsImpl() { | |
| 31 FOR_EACH_OBSERVER(BlimpContentsObserver, observers_, OnContentsDestroyed()); | |
| 32 } | |
| 28 | 33 |
| 29 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
| 30 | 35 |
| 31 base::android::ScopedJavaLocalRef<jobject> | 36 base::android::ScopedJavaLocalRef<jobject> |
| 32 BlimpContentsImpl::GetJavaBlimpContentsImpl() { | 37 BlimpContentsImpl::GetJavaBlimpContentsImpl() { |
| 33 return GetBlimpContentsImplAndroid()->GetJavaObject(); | 38 return GetBlimpContentsImplAndroid()->GetJavaObject(); |
| 34 } | 39 } |
| 35 | 40 |
| 36 BlimpContentsImplAndroid* BlimpContentsImpl::GetBlimpContentsImplAndroid() { | 41 BlimpContentsImplAndroid* BlimpContentsImpl::GetBlimpContentsImplAndroid() { |
| 37 BlimpContentsImplAndroid* blimp_contents_impl_android = | 42 BlimpContentsImplAndroid* blimp_contents_impl_android = |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 57 void BlimpContentsImpl::RemoveObserver(BlimpContentsObserver* observer) { | 62 void BlimpContentsImpl::RemoveObserver(BlimpContentsObserver* observer) { |
| 58 observers_.RemoveObserver(observer); | 63 observers_.RemoveObserver(observer); |
| 59 } | 64 } |
| 60 | 65 |
| 61 void BlimpContentsImpl::NotifyURLLoaded(const GURL& url) { | 66 void BlimpContentsImpl::NotifyURLLoaded(const GURL& url) { |
| 62 FOR_EACH_OBSERVER(BlimpContentsObserver, observers_, OnURLUpdated(url)); | 67 FOR_EACH_OBSERVER(BlimpContentsObserver, observers_, OnURLUpdated(url)); |
| 63 } | 68 } |
| 64 | 69 |
| 65 } // namespace client | 70 } // namespace client |
| 66 } // namespace blimp | 71 } // namespace blimp |
| OLD | NEW |