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/core/contents/tab_control_feature.h" | 9 #include "blimp/client/core/contents/tab_control_feature.h" |
10 #include "blimp/client/public/contents/blimp_contents_observer.h" | 10 #include "blimp/client/public/contents/blimp_contents_observer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 : navigation_controller_(this, nullptr), | 28 : navigation_controller_(this, nullptr), |
29 id_(id), | 29 id_(id), |
30 tab_control_feature_(tab_control_feature) {} | 30 tab_control_feature_(tab_control_feature) {} |
31 | 31 |
32 BlimpContentsImpl::~BlimpContentsImpl() { | 32 BlimpContentsImpl::~BlimpContentsImpl() { |
33 FOR_EACH_OBSERVER(BlimpContentsObserver, observers_, BlimpContentsDying()); | 33 FOR_EACH_OBSERVER(BlimpContentsObserver, observers_, BlimpContentsDying()); |
34 } | 34 } |
35 | 35 |
36 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
37 | 37 |
38 base::android::ScopedJavaLocalRef<jobject> | 38 base::android::ScopedJavaLocalRef<jobject> BlimpContentsImpl::GetJavaObject() { |
39 BlimpContentsImpl::GetJavaBlimpContentsImpl() { | |
40 return GetBlimpContentsImplAndroid()->GetJavaObject(); | 39 return GetBlimpContentsImplAndroid()->GetJavaObject(); |
41 } | 40 } |
42 | 41 |
43 BlimpContentsImplAndroid* BlimpContentsImpl::GetBlimpContentsImplAndroid() { | 42 BlimpContentsImplAndroid* BlimpContentsImpl::GetBlimpContentsImplAndroid() { |
44 BlimpContentsImplAndroid* blimp_contents_impl_android = | 43 BlimpContentsImplAndroid* blimp_contents_impl_android = |
45 static_cast<BlimpContentsImplAndroid*>( | 44 static_cast<BlimpContentsImplAndroid*>( |
46 GetUserData(kBlimpContentsImplAndroidKey)); | 45 GetUserData(kBlimpContentsImplAndroidKey)); |
47 if (!blimp_contents_impl_android) { | 46 if (!blimp_contents_impl_android) { |
48 blimp_contents_impl_android = new BlimpContentsImplAndroid(this); | 47 blimp_contents_impl_android = new BlimpContentsImplAndroid(this); |
49 SetUserData(kBlimpContentsImplAndroidKey, blimp_contents_impl_android); | 48 SetUserData(kBlimpContentsImplAndroidKey, blimp_contents_impl_android); |
(...skipping 24 matching lines...) Expand all Loading... |
74 OnNavigationStateChanged()); | 73 OnNavigationStateChanged()); |
75 } | 74 } |
76 | 75 |
77 void BlimpContentsImpl::SetSizeAndScale(const gfx::Size& size, | 76 void BlimpContentsImpl::SetSizeAndScale(const gfx::Size& size, |
78 float device_pixel_ratio) { | 77 float device_pixel_ratio) { |
79 tab_control_feature_->SetSizeAndScale(size, device_pixel_ratio); | 78 tab_control_feature_->SetSizeAndScale(size, device_pixel_ratio); |
80 } | 79 } |
81 | 80 |
82 } // namespace client | 81 } // namespace client |
83 } // namespace blimp | 82 } // namespace blimp |
OLD | NEW |