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

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

Issue 2902043005: [vr] Add incognito coloring (Closed)
Patch Set: rebase Created 3 years, 7 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 16 matching lines...) Expand all
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_iterator.h" 42 #include "content/public/browser/render_widget_host_iterator.h"
42 #include "content/public/browser/render_widget_host_view.h" 43 #include "content/public/browser/render_widget_host_view.h"
43 #include "content/public/browser/web_contents.h" 44 #include "content/public/browser/web_contents.h"
44 #include "content/public/common/content_features.h" 45 #include "content/public/common/content_features.h"
45 #include "content/public/common/referrer.h" 46 #include "content/public/common/referrer.h"
46 #include "device/vr/android/gvr/cardboard_gamepad_data_fetcher.h" 47 #include "device/vr/android/gvr/cardboard_gamepad_data_fetcher.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 metrics_helper_->SetVRActive(true); 162 metrics_helper_->SetVRActive(true);
162 metrics_helper_->SetWebVREnabled(webvr_mode_); 163 metrics_helper_->SetWebVREnabled(webvr_mode_);
163 } 164 }
164 165
165 void VrShell::SetUiState() { 166 void VrShell::SetUiState() {
166 if (!web_contents_) { 167 if (!web_contents_) {
167 // TODO(mthiesse): Properly handle native page URLs. 168 // TODO(mthiesse): Properly handle native page URLs.
168 ui_->SetURL(GURL()); 169 ui_->SetURL(GURL());
169 ui_->SetLoading(false); 170 ui_->SetLoading(false);
170 ui_->SetFullscreen(false); 171 ui_->SetFullscreen(false);
171 ui_->SetURL(GURL()); 172 ui_->SetURL(GURL());
cjgrant 2017/05/26 16:29:25 It looks like a previous rebase yielded a duplicat
Ian Vollick 2017/05/27 00:30:18 Done.
172 } else { 173 } else {
173 ui_->SetURL(web_contents_->GetVisibleURL()); 174 ui_->SetURL(web_contents_->GetVisibleURL());
174 ui_->SetLoading(web_contents_->IsLoading()); 175 ui_->SetLoading(web_contents_->IsLoading());
175 ui_->SetFullscreen(web_contents_->IsFullscreen()); 176 ui_->SetFullscreen(web_contents_->IsFullscreen());
177 ui_->SetIncognito(web_contents_->GetBrowserContext()->IsOffTheRecord());
cjgrant 2017/05/26 16:29:25 Shouldn't this be in the if() case above, setting
Ian Vollick 2017/05/27 00:30:18 Done.
176 } 178 }
177 } 179 }
178 180
179 bool RegisterVrShell(JNIEnv* env) { 181 bool RegisterVrShell(JNIEnv* env) {
180 return RegisterNativesImpl(env); 182 return RegisterNativesImpl(env);
181 } 183 }
182 184
183 VrShell::~VrShell() { 185 VrShell::~VrShell() {
184 DVLOG(1) << __FUNCTION__ << "=" << this; 186 DVLOG(1) << __FUNCTION__ << "=" << this;
185 poll_capturing_media_task_.Cancel(); 187 poll_capturing_media_task_.Cancel();
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 jlong gvr_api, 713 jlong gvr_api,
712 jboolean reprojected_rendering) { 714 jboolean reprojected_rendering) {
713 return reinterpret_cast<intptr_t>(new VrShell( 715 return reinterpret_cast<intptr_t>(new VrShell(
714 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), 716 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
715 for_web_vr, in_cct, 717 for_web_vr, in_cct,
716 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 718 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
717 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 719 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
718 } 720 }
719 721
720 } // namespace vr_shell 722 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698