| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/android/vr_shell/vr_controller_model.h" | 27 #include "chrome/browser/android/vr_shell/vr_controller_model.h" |
| 28 #include "chrome/browser/android/vr_shell/vr_gl_thread.h" | 28 #include "chrome/browser/android/vr_shell/vr_gl_thread.h" |
| 29 #include "chrome/browser/android/vr_shell/vr_input_manager.h" | 29 #include "chrome/browser/android/vr_shell/vr_input_manager.h" |
| 30 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" | 30 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" |
| 31 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" | 31 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
| 32 #include "chrome/browser/android/vr_shell/vr_tab_helper.h" | 32 #include "chrome/browser/android/vr_shell/vr_tab_helper.h" |
| 33 #include "chrome/browser/android/vr_shell/vr_usage_monitor.h" | 33 #include "chrome/browser/android/vr_shell/vr_usage_monitor.h" |
| 34 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h" | 34 #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h" |
| 35 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 35 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 36 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" | 36 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" |
| 37 #include "content/public/browser/browser_context.h" |
| 37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/navigation_controller.h" | 39 #include "content/public/browser/navigation_controller.h" |
| 39 #include "content/public/browser/render_view_host.h" | 40 #include "content/public/browser/render_view_host.h" |
| 40 #include "content/public/browser/render_widget_host.h" | 41 #include "content/public/browser/render_widget_host.h" |
| 41 #include "content/public/browser/render_widget_host_view.h" | 42 #include "content/public/browser/render_widget_host_view.h" |
| 42 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 43 #include "content/public/common/content_features.h" | 44 #include "content/public/common/content_features.h" |
| 44 #include "content/public/common/referrer.h" | 45 #include "content/public/common/referrer.h" |
| 45 #include "device/vr/android/gvr/cardboard_gamepad_data_fetcher.h" | 46 #include "device/vr/android/gvr/cardboard_gamepad_data_fetcher.h" |
| 46 #include "device/vr/android/gvr/gvr_device.h" | 47 #include "device/vr/android/gvr/gvr_device.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!web_contents_) { | 166 if (!web_contents_) { |
| 166 // TODO(mthiesse): Properly handle native page URLs. | 167 // TODO(mthiesse): Properly handle native page URLs. |
| 167 ui_->SetURL(GURL()); | 168 ui_->SetURL(GURL()); |
| 168 ui_->SetLoading(false); | 169 ui_->SetLoading(false); |
| 169 ui_->SetFullscreen(false); | 170 ui_->SetFullscreen(false); |
| 170 ui_->SetURL(GURL()); | 171 ui_->SetURL(GURL()); |
| 171 } else { | 172 } else { |
| 172 ui_->SetURL(web_contents_->GetVisibleURL()); | 173 ui_->SetURL(web_contents_->GetVisibleURL()); |
| 173 ui_->SetLoading(web_contents_->IsLoading()); | 174 ui_->SetLoading(web_contents_->IsLoading()); |
| 174 ui_->SetFullscreen(web_contents_->IsFullscreen()); | 175 ui_->SetFullscreen(web_contents_->IsFullscreen()); |
| 176 ui_->SetIncognito(web_contents_->GetBrowserContext()->IsOffTheRecord()); |
| 175 } | 177 } |
| 176 } | 178 } |
| 177 | 179 |
| 178 bool RegisterVrShell(JNIEnv* env) { | 180 bool RegisterVrShell(JNIEnv* env) { |
| 179 return RegisterNativesImpl(env); | 181 return RegisterNativesImpl(env); |
| 180 } | 182 } |
| 181 | 183 |
| 182 VrShell::~VrShell() { | 184 VrShell::~VrShell() { |
| 183 DVLOG(1) << __FUNCTION__ << "=" << this; | 185 DVLOG(1) << __FUNCTION__ << "=" << this; |
| 184 poll_capturing_media_task_.Cancel(); | 186 poll_capturing_media_task_.Cancel(); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 jlong gvr_api, | 697 jlong gvr_api, |
| 696 jboolean reprojected_rendering) { | 698 jboolean reprojected_rendering) { |
| 697 return reinterpret_cast<intptr_t>(new VrShell( | 699 return reinterpret_cast<intptr_t>(new VrShell( |
| 698 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 700 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 699 for_web_vr, in_cct, | 701 for_web_vr, in_cct, |
| 700 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 702 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 701 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 703 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 702 } | 704 } |
| 703 | 705 |
| 704 } // namespace vr_shell | 706 } // namespace vr_shell |
| OLD | NEW |