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

Side by Side Diff: blimp/client/app/android/blimp_view.cc

Issue 2325893002: [blimp] Add support for having multiple tabs (Closed)
Patch Set: Add tablet and non-blimp support Created 4 years, 3 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
« no previous file with comments | « no previous file | blimp/client/app/linux/blimp_display_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/app/android/blimp_view.h" 5 #include "blimp/client/app/android/blimp_view.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "blimp/client/app/android/blimp_client_session_android.h" 10 #include "blimp/client/app/android/blimp_client_session_android.h"
11 #include "blimp/client/app/compositor/browser_compositor.h" 11 #include "blimp/client/app/compositor/browser_compositor.h"
12 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" 12 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h"
13 #include "blimp/client/core/compositor/blimp_compositor_manager.h" 13 #include "blimp/client/core/compositor/blimp_compositor_manager.h"
14 #include "blimp/client/core/render_widget/render_widget_feature.h" 14 #include "blimp/client/core/render_widget/render_widget_feature.h"
15 #include "blimp/client/support/compositor/compositor_dependencies_impl.h" 15 #include "blimp/client/support/compositor/compositor_dependencies_impl.h"
16 #include "jni/BlimpView_jni.h" 16 #include "jni/BlimpView_jni.h"
17 #include "ui/events/android/motion_event_android.h" 17 #include "ui/events/android/motion_event_android.h"
18 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
19 19
20 using base::android::JavaParamRef; 20 using base::android::JavaParamRef;
21 21
22 namespace {
23 const int kDummyBlimpContentsId = 0;
24 } // namespace
25
22 namespace blimp { 26 namespace blimp {
23 namespace client { 27 namespace client {
24 namespace app { 28 namespace app {
25 29
26 static jlong Init(JNIEnv* env, 30 static jlong Init(JNIEnv* env,
27 const JavaParamRef<jobject>& jobj, 31 const JavaParamRef<jobject>& jobj,
28 const JavaParamRef<jobject>& blimp_client_session, 32 const JavaParamRef<jobject>& blimp_client_session,
29 jint real_width, 33 jint real_width,
30 jint real_height, 34 jint real_height,
31 jint width, 35 jint width,
(...skipping 29 matching lines...) Expand all
61 weak_ptr_factory_(this) { 65 weak_ptr_factory_(this) {
62 compositor_dependencies_ = base::MakeUnique<BlimpCompositorDependencies>( 66 compositor_dependencies_ = base::MakeUnique<BlimpCompositorDependencies>(
63 base::MakeUnique<CompositorDependenciesImpl>()); 67 base::MakeUnique<CompositorDependenciesImpl>());
64 68
65 compositor_ = base::MakeUnique<BrowserCompositor>( 69 compositor_ = base::MakeUnique<BrowserCompositor>(
66 compositor_dependencies_->GetEmbedderDependencies()); 70 compositor_dependencies_->GetEmbedderDependencies());
67 compositor_->set_did_complete_swap_buffers_callback(base::Bind( 71 compositor_->set_did_complete_swap_buffers_callback(base::Bind(
68 &BlimpView::OnSwapBuffersCompleted, weak_ptr_factory_.GetWeakPtr())); 72 &BlimpView::OnSwapBuffersCompleted, weak_ptr_factory_.GetWeakPtr()));
69 73
70 compositor_manager_ = base::MakeUnique<BlimpCompositorManager>( 74 compositor_manager_ = base::MakeUnique<BlimpCompositorManager>(
71 render_widget_feature, compositor_dependencies_.get()); 75 kDummyBlimpContentsId, render_widget_feature,
76 compositor_dependencies_.get());
72 compositor_->SetContentLayer(compositor_manager_->layer()); 77 compositor_->SetContentLayer(compositor_manager_->layer());
73 78
74 java_obj_.Reset(env, jobj); 79 java_obj_.Reset(env, jobj);
75 } 80 }
76 81
77 BlimpView::~BlimpView() { 82 BlimpView::~BlimpView() {
78 SetSurface(nullptr); 83 SetSurface(nullptr);
79 84
80 // Destroy the BrowserCompositor and the BlimpCompositorManager before the 85 // Destroy the BrowserCompositor and the BlimpCompositorManager before the
81 // BlimpCompositorDependencies. 86 // BlimpCompositorDependencies.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 210 }
206 211
207 void BlimpView::OnSwapBuffersCompleted() { 212 void BlimpView::OnSwapBuffersCompleted() {
208 JNIEnv* env = base::android::AttachCurrentThread(); 213 JNIEnv* env = base::android::AttachCurrentThread();
209 Java_BlimpView_onSwapBuffersCompleted(env, java_obj_); 214 Java_BlimpView_onSwapBuffersCompleted(env, java_obj_);
210 } 215 }
211 216
212 } // namespace app 217 } // namespace app
213 } // namespace client 218 } // namespace client
214 } // namespace blimp 219 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | blimp/client/app/linux/blimp_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698