| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "services/native_viewport/platform_viewport_android.h" | 5 #include "services/native_viewport/platform_viewport_android.h" |
| 6 | 6 |
| 7 #include <android/input.h> | 7 #include <android/input.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
| 162 // PlatformViewportAndroid, PlatformViewport implementation: | 162 // PlatformViewportAndroid, PlatformViewport implementation: |
| 163 | 163 |
| 164 void PlatformViewportAndroid::Init(const gfx::Rect& bounds) { | 164 void PlatformViewportAndroid::Init(const gfx::Rect& bounds) { |
| 165 JNIEnv* env = base::android::AttachCurrentThread(); | 165 JNIEnv* env = base::android::AttachCurrentThread(); |
| 166 Java_PlatformViewportAndroid_createRequest(env, | 166 Java_PlatformViewportAndroid_createRequest(env, |
| 167 reinterpret_cast<intptr_t>(this)); | 167 reinterpret_cast<intptr_t>(this)); |
| 168 | 168 |
| 169 application_->ConnectToService("mojo:native_viewport_support", | 169 application_->ConnectToServiceDeprecated("mojo:native_viewport_support", |
| 170 &support_service_); | 170 &support_service_); |
| 171 support_service_->CreateNewNativeWindow( | 171 support_service_->CreateNewNativeWindow( |
| 172 base::Bind(&PlatformViewportAndroid::Close, weak_factory_.GetWeakPtr())); | 172 base::Bind(&PlatformViewportAndroid::Close, weak_factory_.GetWeakPtr())); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void PlatformViewportAndroid::Show() { | 175 void PlatformViewportAndroid::Show() { |
| 176 // Nothing to do. View is created visible. | 176 // Nothing to do. View is created visible. |
| 177 } | 177 } |
| 178 | 178 |
| 179 void PlatformViewportAndroid::Hide() { | 179 void PlatformViewportAndroid::Hide() { |
| 180 // Nothing to do. View is always visible. | 180 // Nothing to do. View is always visible. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 209 // static | 209 // static |
| 210 scoped_ptr<PlatformViewport> PlatformViewport::Create( | 210 scoped_ptr<PlatformViewport> PlatformViewport::Create( |
| 211 mojo::ApplicationImpl* application_, | 211 mojo::ApplicationImpl* application_, |
| 212 Delegate* delegate) { | 212 Delegate* delegate) { |
| 213 return scoped_ptr<PlatformViewport>( | 213 return scoped_ptr<PlatformViewport>( |
| 214 new PlatformViewportAndroid(application_, delegate)) | 214 new PlatformViewportAndroid(application_, delegate)) |
| 215 .Pass(); | 215 .Pass(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace native_viewport | 218 } // namespace native_viewport |
| OLD | NEW |