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 "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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 529 |
530 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host, | 530 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host, |
531 content::RenderViewHost* new_host) { | 531 content::RenderViewHost* new_host) { |
532 content::RenderWidgetHostView* view = new_host->GetWidget()->GetView(); | 532 content::RenderWidgetHostView* view = new_host->GetWidget()->GetView(); |
533 view->SetBackgroundColor(SK_ColorTRANSPARENT); | 533 view->SetBackgroundColor(SK_ColorTRANSPARENT); |
534 view->SetIsInVR(true); | 534 view->SetIsInVR(true); |
535 } | 535 } |
536 | 536 |
537 void VrShell::MainFrameWasResized(bool width_changed) { | 537 void VrShell::MainFrameWasResized(bool width_changed) { |
538 display::Display display = | 538 display::Display display = |
539 display::Screen::GetScreen()->GetDisplayNearestWindow( | 539 display::Screen::GetScreen()->GetDisplayNearestView( |
540 ui_contents_->GetNativeView()); | 540 ui_contents_->GetNativeView()); |
541 PostToGlThreadWhenReady( | 541 PostToGlThreadWhenReady( |
542 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(), | 542 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(), |
543 display.size().width(), display.size().height())); | 543 display.size().width(), display.size().height())); |
544 } | 544 } |
545 | 545 |
546 void VrShell::ContentFrameWasResized(bool width_changed) { | 546 void VrShell::ContentFrameWasResized(bool width_changed) { |
547 display::Display display = | 547 display::Display display = |
548 display::Screen::GetScreen()->GetDisplayNearestWindow(content_window_); | 548 display::Screen::GetScreen()->GetDisplayNearestWindow(content_window_); |
549 PostToGlThreadWhenReady( | 549 PostToGlThreadWhenReady( |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 jboolean reprojected_rendering) { | 745 jboolean reprojected_rendering) { |
746 return reinterpret_cast<intptr_t>(new VrShell( | 746 return reinterpret_cast<intptr_t>(new VrShell( |
747 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), | 747 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), |
748 content::WebContents::FromJavaWebContents(ui_web_contents), | 748 content::WebContents::FromJavaWebContents(ui_web_contents), |
749 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, | 749 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, |
750 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 750 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
751 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 751 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
752 } | 752 } |
753 | 753 |
754 } // namespace vr_shell | 754 } // namespace vr_shell |
OLD | NEW |