| 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 "chromecast/browser/android/cast_content_window_android.h" | 5 #include "chromecast/browser/android/cast_content_window_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chromecast/base/metrics/cast_metrics_helper.h" | 10 #include "chromecast/base/metrics/cast_metrics_helper.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 CastContentWindowAndroid::~CastContentWindowAndroid() { | 52 CastContentWindowAndroid::~CastContentWindowAndroid() { |
| 53 JNIEnv* env = base::android::AttachCurrentThread(); | 53 JNIEnv* env = base::android::AttachCurrentThread(); |
| 54 Java_CastContentWindowAndroid_onNativeDestroyed(env, java_window_.obj()); | 54 Java_CastContentWindowAndroid_onNativeDestroyed(env, java_window_.obj()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void CastContentWindowAndroid::SetTransparent() { | 57 void CastContentWindowAndroid::SetTransparent() { |
| 58 transparent_ = true; | 58 transparent_ = true; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void CastContentWindowAndroid::ShowWebContents( | 61 void CastContentWindowAndroid::ShowWebContents( |
| 62 content::WebContents* web_contents) { | 62 content::WebContents* web_contents, |
| 63 CastWindowManager* window_manager) { |
| 63 JNIEnv* env = base::android::AttachCurrentThread(); | 64 JNIEnv* env = base::android::AttachCurrentThread(); |
| 64 base::android::ScopedJavaLocalRef<jobject> java_web_contents = | 65 base::android::ScopedJavaLocalRef<jobject> java_web_contents = |
| 65 web_contents->GetJavaWebContents(); | 66 web_contents->GetJavaWebContents(); |
| 66 | 67 |
| 67 Java_CastContentWindowAndroid_showWebContents(env, java_window_.obj(), | 68 Java_CastContentWindowAndroid_showWebContents(env, java_window_.obj(), |
| 68 java_web_contents.obj()); | 69 java_web_contents.obj()); |
| 69 } | 70 } |
| 70 | 71 |
| 71 std::unique_ptr<content::WebContents> | 72 std::unique_ptr<content::WebContents> |
| 72 CastContentWindowAndroid::CreateWebContents( | 73 CastContentWindowAndroid::CreateWebContents( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const base::android::JavaParamRef<jobject>& jcaller, | 127 const base::android::JavaParamRef<jobject>& jcaller, |
| 127 int keycode) { | 128 int keycode) { |
| 128 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, | 129 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, |
| 129 ui::KeyboardCodeFromAndroidKeyCode(keycode), | 130 ui::KeyboardCodeFromAndroidKeyCode(keycode), |
| 130 ui::EF_NONE); | 131 ui::EF_NONE); |
| 131 delegate_->OnKeyEvent(key_event); | 132 delegate_->OnKeyEvent(key_event); |
| 132 } | 133 } |
| 133 | 134 |
| 134 } // namespace shell | 135 } // namespace shell |
| 135 } // namespace chromecast | 136 } // namespace chromecast |
| OLD | NEW |