| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 // Enables a callback when the underlying WebContents is destroyed, to enable | 165 // Enables a callback when the underlying WebContents is destroyed, to enable |
| 166 // nulling the back-pointer. | 166 // nulling the back-pointer. |
| 167 class ContentViewCoreImpl::ContentViewUserData | 167 class ContentViewCoreImpl::ContentViewUserData |
| 168 : public base::SupportsUserData::Data { | 168 : public base::SupportsUserData::Data { |
| 169 public: | 169 public: |
| 170 explicit ContentViewUserData(ContentViewCoreImpl* content_view_core) | 170 explicit ContentViewUserData(ContentViewCoreImpl* content_view_core) |
| 171 : content_view_core_(content_view_core) { | 171 : content_view_core_(content_view_core) { |
| 172 } | 172 } |
| 173 | 173 |
| 174 virtual ~ContentViewUserData() { | 174 ~ContentViewUserData() override { |
| 175 // TODO(joth): When chrome has finished removing the TabContents class (see | 175 // TODO(joth): When chrome has finished removing the TabContents class (see |
| 176 // crbug.com/107201) consider inverting relationship, so ContentViewCore | 176 // crbug.com/107201) consider inverting relationship, so ContentViewCore |
| 177 // would own WebContents. That effectively implies making the WebContents | 177 // would own WebContents. That effectively implies making the WebContents |
| 178 // destructor private on Android. | 178 // destructor private on Android. |
| 179 delete content_view_core_; | 179 delete content_view_core_; |
| 180 } | 180 } |
| 181 | 181 |
| 182 ContentViewCoreImpl* get() const { return content_view_core_; } | 182 ContentViewCoreImpl* get() const { return content_view_core_; } |
| 183 | 183 |
| 184 private: | 184 private: |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 return NULL; | 1381 return NULL; |
| 1382 | 1382 |
| 1383 return view->GetJavaObject().Release(); | 1383 return view->GetJavaObject().Release(); |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 bool RegisterContentViewCore(JNIEnv* env) { | 1386 bool RegisterContentViewCore(JNIEnv* env) { |
| 1387 return RegisterNativesImpl(env); | 1387 return RegisterNativesImpl(env); |
| 1388 } | 1388 } |
| 1389 | 1389 |
| 1390 } // namespace content | 1390 } // namespace content |
| OLD | NEW |