| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ui_scene_manager.h" | 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" | 9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning
.h" | 10 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning
.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 void UiSceneManager::OnAppButtonClicked() { | 200 void UiSceneManager::OnAppButtonClicked() { |
| 201 // Pressing the app button currenly pauses content rendering. Note: its still | 201 // Pressing the app button currenly pauses content rendering. Note: its still |
| 202 // unclear what we want to do here and this will most likely change. | 202 // unclear what we want to do here and this will most likely change. |
| 203 content_rendering_enabled_ = !content_rendering_enabled_; | 203 content_rendering_enabled_ = !content_rendering_enabled_; |
| 204 scene_->SetWebVrRenderingEnabled(content_rendering_enabled_); | 204 scene_->SetWebVrRenderingEnabled(content_rendering_enabled_); |
| 205 browser_->OnContentPaused(!content_rendering_enabled_); | 205 browser_->OnContentPaused(!content_rendering_enabled_); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void UiSceneManager::OnAppButtonGesturePerformed( |
| 209 UiInterface::Direction direction) {} |
| 210 |
| 208 void UiSceneManager::ConfigureSecurityWarnings() { | 211 void UiSceneManager::ConfigureSecurityWarnings() { |
| 209 bool enabled = web_vr_mode_ && !secure_origin_; | 212 bool enabled = web_vr_mode_ && !secure_origin_; |
| 210 permanent_security_warning_->set_visible(enabled); | 213 permanent_security_warning_->set_visible(enabled); |
| 211 transient_security_warning_->set_visible(enabled); | 214 transient_security_warning_->set_visible(enabled); |
| 212 if (enabled) { | 215 if (enabled) { |
| 213 security_warning_timer_.Start( | 216 security_warning_timer_.Start( |
| 214 FROM_HERE, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds), this, | 217 FROM_HERE, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds), this, |
| 215 &UiSceneManager::OnSecurityWarningTimer); | 218 &UiSceneManager::OnSecurityWarningTimer); |
| 216 } else { | 219 } else { |
| 217 security_warning_timer_.Stop(); | 220 security_warning_timer_.Stop(); |
| 218 } | 221 } |
| 219 } | 222 } |
| 220 | 223 |
| 221 void UiSceneManager::OnSecurityWarningTimer() { | 224 void UiSceneManager::OnSecurityWarningTimer() { |
| 222 transient_security_warning_->set_visible(false); | 225 transient_security_warning_->set_visible(false); |
| 223 } | 226 } |
| 224 | 227 |
| 225 void UiSceneManager::OnUrlChange(const GURL& gurl) { | 228 void UiSceneManager::SetURL(const GURL& gurl) { |
| 226 url_bar_->SetGURL(gurl); | 229 url_bar_->SetURL(gurl); |
| 227 } | 230 } |
| 228 | 231 |
| 232 void UiSceneManager::SetFullscreen(bool enabled) {} |
| 233 |
| 234 void UiSceneManager::SetSecurityLevel(int level) {} |
| 235 |
| 236 void UiSceneManager::SetLoading(bool loading) {} |
| 237 |
| 238 void UiSceneManager::SetLoadProgress(double progress) {} |
| 239 |
| 240 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, |
| 241 bool can_go_forward) {} |
| 242 |
| 229 int UiSceneManager::AllocateId() { | 243 int UiSceneManager::AllocateId() { |
| 230 return next_available_id_++; | 244 return next_available_id_++; |
| 231 } | 245 } |
| 232 | 246 |
| 233 } // namespace vr_shell | 247 } // namespace vr_shell |
| OLD | NEW |