| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 ui::PageTransition::PAGE_TRANSITION_TYPED); | 494 ui::PageTransition::PAGE_TRANSITION_TYPED); |
| 495 break; | 495 break; |
| 496 } | 496 } |
| 497 default: | 497 default: |
| 498 NOTREACHED(); | 498 NOTREACHED(); |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host, | 502 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host, |
| 503 content::RenderViewHost* new_host) { | 503 content::RenderViewHost* new_host) { |
| 504 new_host->GetWidget()->GetView()->SetBackgroundColor(SK_ColorTRANSPARENT); | 504 content::RenderWidgetHostView* view = new_host->GetWidget()->GetView(); |
| 505 view->SetBackgroundColor(SK_ColorTRANSPARENT); |
| 506 view->SetIsInVR(true); |
| 505 } | 507 } |
| 506 | 508 |
| 507 void VrShell::MainFrameWasResized(bool width_changed) { | 509 void VrShell::MainFrameWasResized(bool width_changed) { |
| 508 display::Display display = | 510 display::Display display = |
| 509 display::Screen::GetScreen()->GetDisplayNearestWindow( | 511 display::Screen::GetScreen()->GetDisplayNearestWindow( |
| 510 ui_contents_->GetNativeView()); | 512 ui_contents_->GetNativeView()); |
| 511 PostToGlThreadWhenReady( | 513 PostToGlThreadWhenReady( |
| 512 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(), | 514 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(), |
| 513 display.size().width(), display.size().height())); | 515 display.size().width(), display.size().height())); |
| 514 } | 516 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 jboolean reprojected_rendering) { | 689 jboolean reprojected_rendering) { |
| 688 return reinterpret_cast<intptr_t>(new VrShell( | 690 return reinterpret_cast<intptr_t>(new VrShell( |
| 689 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), | 691 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), |
| 690 content::WebContents::FromJavaWebContents(ui_web_contents), | 692 content::WebContents::FromJavaWebContents(ui_web_contents), |
| 691 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, | 693 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, |
| 692 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 694 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 693 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 695 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 694 } | 696 } |
| 695 | 697 |
| 696 } // namespace vr_shell | 698 } // namespace vr_shell |
| OLD | NEW |