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 "mojo/services/native_viewport/native_viewport_android.h" | 5 #include "mojo/services/native_viewport/native_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 //////////////////////////////////////////////////////////////////////////////// | 95 //////////////////////////////////////////////////////////////////////////////// |
96 // NativeViewportAndroid, NativeViewport implementation: | 96 // NativeViewportAndroid, NativeViewport implementation: |
97 | 97 |
98 void NativeViewportAndroid::Init(const gfx::Rect& bounds) { | 98 void NativeViewportAndroid::Init(const gfx::Rect& bounds) { |
99 JNIEnv* env = base::android::AttachCurrentThread(); | 99 JNIEnv* env = base::android::AttachCurrentThread(); |
100 Java_NativeViewportAndroid_createForActivity(env, context_->activity(), | 100 Java_NativeViewportAndroid_createForActivity(env, context_->activity(), |
101 reinterpret_cast<jint>(this)); | 101 reinterpret_cast<jlong>(this)); |
102 } | 102 } |
103 | 103 |
104 void NativeViewportAndroid::Show() { | 104 void NativeViewportAndroid::Show() { |
105 // Nothing to do. View is created visible. | 105 // Nothing to do. View is created visible. |
106 } | 106 } |
107 | 107 |
108 void NativeViewportAndroid::Hide() { | 108 void NativeViewportAndroid::Hide() { |
109 // Nothing to do. View is always visible. | 109 // Nothing to do. View is always visible. |
110 } | 110 } |
111 | 111 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // static | 146 // static |
147 scoped_ptr<NativeViewport> NativeViewport::Create( | 147 scoped_ptr<NativeViewport> NativeViewport::Create( |
148 shell::Context* context, | 148 shell::Context* context, |
149 NativeViewportDelegate* delegate) { | 149 NativeViewportDelegate* delegate) { |
150 return scoped_ptr<NativeViewport>( | 150 return scoped_ptr<NativeViewport>( |
151 new NativeViewportAndroid(context, delegate)).Pass(); | 151 new NativeViewportAndroid(context, delegate)).Pass(); |
152 } | 152 } |
153 | 153 |
154 } // namespace services | 154 } // namespace services |
155 } // namespace mojo | 155 } // namespace mojo |
OLD | NEW |