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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2735983004: Visually disable VR Shell back/forward buttons when no history is available (Closed)
Patch Set: Addressing closure compilation error Created 3 years, 9 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 "chrome/browser/android/vr_shell/vr_shell.h" 5 #include "chrome/browser/android/vr_shell/vr_shell.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 content_surface_ = nullptr; 359 content_surface_ = nullptr;
360 return surface; 360 return surface;
361 } 361 }
362 362
363 void VrShell::RestoreContentSurface(JNIEnv* env, 363 void VrShell::RestoreContentSurface(JNIEnv* env,
364 const JavaParamRef<jobject>& obj) { 364 const JavaParamRef<jobject>& obj) {
365 PostToGlThreadWhenReady( 365 PostToGlThreadWhenReady(
366 base::Bind(&VrShellGl::CreateContentSurface, gl_thread_->GetVrShellGl())); 366 base::Bind(&VrShellGl::CreateContentSurface, gl_thread_->GetVrShellGl()));
367 } 367 }
368 368
369 void VrShell::SetHistoryButtonsEnabled(JNIEnv* env,
370 const JavaParamRef<jobject>& obj,
371 jboolean can_go_back,
372 jboolean can_go_forward) {
373 html_interface_->SetHistoryButtonsEnabled(can_go_back, can_go_forward);
374 }
375
369 void VrShell::UiSurfaceChanged(jobject surface) { 376 void VrShell::UiSurfaceChanged(jobject surface) {
370 ui_compositor_->SurfaceChanged(surface); 377 ui_compositor_->SurfaceChanged(surface);
371 } 378 }
372 379
373 void VrShell::ContentSurfaceChanged(jobject surface) { 380 void VrShell::ContentSurfaceChanged(jobject surface) {
374 content_surface_ = surface; 381 content_surface_ = surface;
375 content_compositor_->SurfaceChanged(surface); 382 content_compositor_->SurfaceChanged(surface);
376 JNIEnv* env = base::android::AttachCurrentThread(); 383 JNIEnv* env = base::android::AttachCurrentThread();
377 Java_VrShellImpl_contentSurfaceChanged(env, j_vr_shell_.obj()); 384 Java_VrShellImpl_contentSurfaceChanged(env, j_vr_shell_.obj());
378 } 385 }
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 jboolean reprojected_rendering) { 694 jboolean reprojected_rendering) {
688 return reinterpret_cast<intptr_t>(new VrShell( 695 return reinterpret_cast<intptr_t>(new VrShell(
689 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), 696 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android),
690 content::WebContents::FromJavaWebContents(ui_web_contents), 697 content::WebContents::FromJavaWebContents(ui_web_contents),
691 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, 698 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr,
692 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 699 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
693 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 700 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
694 } 701 }
695 702
696 } // namespace vr_shell 703 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/resources/vr_shell/vr_shell_ui.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698