Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: chromecast/browser/android/cast_content_window_android.cc

Issue 2643553002: [Chromecast] Reuse the Aura window manager across receiver apps. (Closed)
Patch Set: applied reviewer feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) {
64 DCHECK(window_manager);
63 JNIEnv* env = base::android::AttachCurrentThread(); 65 JNIEnv* env = base::android::AttachCurrentThread();
64 base::android::ScopedJavaLocalRef<jobject> java_web_contents = 66 base::android::ScopedJavaLocalRef<jobject> java_web_contents =
65 web_contents->GetJavaWebContents(); 67 web_contents->GetJavaWebContents();
66 68
67 Java_CastContentWindowAndroid_showWebContents(env, java_window_.obj(), 69 Java_CastContentWindowAndroid_showWebContents(env, java_window_.obj(),
68 java_web_contents.obj()); 70 java_web_contents.obj());
69 } 71 }
70 72
71 std::unique_ptr<content::WebContents> 73 std::unique_ptr<content::WebContents>
72 CastContentWindowAndroid::CreateWebContents( 74 CastContentWindowAndroid::CreateWebContents(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const base::android::JavaParamRef<jobject>& jcaller, 128 const base::android::JavaParamRef<jobject>& jcaller,
127 int keycode) { 129 int keycode) {
128 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, 130 ui::KeyEvent key_event(ui::ET_KEY_PRESSED,
129 ui::KeyboardCodeFromAndroidKeyCode(keycode), 131 ui::KeyboardCodeFromAndroidKeyCode(keycode),
130 ui::EF_NONE); 132 ui::EF_NONE);
131 delegate_->OnKeyEvent(key_event); 133 delegate_->OnKeyEvent(key_event);
132 } 134 }
133 135
134 } // namespace shell 136 } // namespace shell
135 } // namespace chromecast 137 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/android/cast_content_window_android.h ('k') | chromecast/browser/cast_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698