| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" | 9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" |
| 10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" | 10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 11 #include "chrome/browser/android/vr_shell/ui_browser_interface.h" | 11 #include "chrome/browser/android/vr_shell/ui_browser_interface.h" |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/button.h" | 12 #include "chrome/browser/android/vr_shell/ui_elements/button.h" |
| 13 #include "chrome/browser/android/vr_shell/ui_elements/exclusive_screen_toast.h" | 13 #include "chrome/browser/android/vr_shell/ui_elements/exclusive_screen_toast.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_elements/exit_prompt.h" | 14 #include "chrome/browser/android/vr_shell/ui_elements/exit_prompt.h" |
| 15 #include "chrome/browser/android/vr_shell/ui_elements/exit_prompt_backplane.h" | 15 #include "chrome/browser/android/vr_shell/ui_elements/exit_prompt_backplane.h" |
| 16 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" | 16 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" |
| 17 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h" | 17 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h" |
| 18 #include "chrome/browser/android/vr_shell/ui_elements/splash_screen_icon.h" | 18 #include "chrome/browser/android/vr_shell/ui_elements/splash_screen_icon.h" |
| 19 #include "chrome/browser/android/vr_shell/ui_elements/system_indicator.h" | 19 #include "chrome/browser/android/vr_shell/ui_elements/system_indicator.h" |
| 20 #include "chrome/browser/android/vr_shell/ui_elements/transient_url_bar.h" | 20 #include "chrome/browser/android/vr_shell/ui_elements/transient_url_bar.h" |
| 21 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" | 21 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 22 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" | 22 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" |
| 23 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" | 23 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" |
| 24 #include "chrome/browser/android/vr_shell/ui_scene.h" | 24 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 25 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| 26 #include "components/vector_icons/vector_icons.h" | 26 #include "components/vector_icons/vector_icons.h" |
| 27 #include "ui/gfx/transform_util.h" |
| 27 #include "ui/vector_icons/vector_icons.h" | 28 #include "ui/vector_icons/vector_icons.h" |
| 28 | 29 |
| 29 namespace vr_shell { | 30 namespace vr_shell { |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 static constexpr int kWarningTimeoutSeconds = 30; | 34 static constexpr int kWarningTimeoutSeconds = 30; |
| 34 static constexpr float kWarningDistance = 0.7; | 35 static constexpr float kWarningDistance = 0.7; |
| 35 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0; | 36 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0; |
| 36 static constexpr float kPermanentWarningHeight = 0.070f; | 37 static constexpr float kPermanentWarningHeight = 0.070f; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 static constexpr float kLoadingIndicatorDepthOffset = | 122 static constexpr float kLoadingIndicatorDepthOffset = |
| 122 (kUrlBarDistance - kContentDistance) / 2; | 123 (kUrlBarDistance - kContentDistance) / 2; |
| 123 | 124 |
| 124 static constexpr float kSceneSize = 25.0; | 125 static constexpr float kSceneSize = 25.0; |
| 125 static constexpr float kSceneHeight = 4.0; | 126 static constexpr float kSceneHeight = 4.0; |
| 126 static constexpr int kFloorGridlineCount = 40; | 127 static constexpr int kFloorGridlineCount = 40; |
| 127 | 128 |
| 128 // Tiny distance to offset textures that should appear in the same plane. | 129 // Tiny distance to offset textures that should appear in the same plane. |
| 129 static constexpr float kTextureOffset = 0.01; | 130 static constexpr float kTextureOffset = 0.01; |
| 130 | 131 |
| 132 static double toDegrees(double radians) { |
| 133 return radians * 180.0 / M_PI; |
| 134 } |
| 135 |
| 131 } // namespace | 136 } // namespace |
| 132 | 137 |
| 133 UiSceneManager::UiSceneManager(UiBrowserInterface* browser, | 138 UiSceneManager::UiSceneManager(UiBrowserInterface* browser, |
| 134 UiScene* scene, | 139 UiScene* scene, |
| 135 bool in_cct, | 140 bool in_cct, |
| 136 bool in_web_vr, | 141 bool in_web_vr, |
| 137 bool web_vr_autopresentation_expected) | 142 bool web_vr_autopresentation_expected) |
| 138 : browser_(browser), | 143 : browser_(browser), |
| 139 scene_(scene), | 144 scene_(scene), |
| 140 in_cct_(in_cct), | 145 in_cct_(in_cct), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 154 CreateExitPrompt(); | 159 CreateExitPrompt(); |
| 155 CreateToasts(); | 160 CreateToasts(); |
| 156 | 161 |
| 157 ConfigureScene(); | 162 ConfigureScene(); |
| 158 } | 163 } |
| 159 | 164 |
| 160 UiSceneManager::~UiSceneManager() {} | 165 UiSceneManager::~UiSceneManager() {} |
| 161 | 166 |
| 162 void UiSceneManager::CreateScreenDimmer() { | 167 void UiSceneManager::CreateScreenDimmer() { |
| 163 std::unique_ptr<UiElement> element; | 168 std::unique_ptr<UiElement> element; |
| 164 element = base::MakeUnique<ScreenDimmer>(); | 169 element = base::MakeUnique<ScreenDimmer>(AllocateId()); |
| 165 element->set_debug_id(kScreenDimmer); | 170 element->set_debug_id(kScreenDimmer); |
| 166 element->set_id(AllocateId()); | |
| 167 element->set_fill(vr_shell::Fill::NONE); | 171 element->set_fill(vr_shell::Fill::NONE); |
| 168 element->set_visible(false); | 172 element->set_visible(false); |
| 169 element->set_hit_testable(false); | 173 element->set_hit_testable(false); |
| 170 element->set_is_overlay(true); | 174 element->set_is_overlay(true); |
| 171 screen_dimmer_ = element.get(); | 175 screen_dimmer_ = element.get(); |
| 172 scene_->AddUiElement(std::move(element)); | 176 scene_->AddUiElement(std::move(element)); |
| 173 } | 177 } |
| 174 | 178 |
| 175 void UiSceneManager::CreateSecurityWarnings() { | 179 void UiSceneManager::CreateSecurityWarnings() { |
| 176 std::unique_ptr<UiElement> element; | 180 std::unique_ptr<UiElement> element; |
| 177 | 181 |
| 178 // TODO(mthiesse): Programatically compute the proper texture size for these | 182 // TODO(mthiesse): Programatically compute the proper texture size for these |
| 179 // textured UI elements. | 183 // textured UI elements. |
| 180 element = base::MakeUnique<PermanentSecurityWarning>(512); | 184 element = base::MakeUnique<PermanentSecurityWarning>(AllocateId(), 512); |
| 181 element->set_debug_id(kWebVrPermanentHttpSecurityWarning); | 185 element->set_debug_id(kWebVrPermanentHttpSecurityWarning); |
| 182 element->set_id(AllocateId()); | |
| 183 element->set_fill(vr_shell::Fill::NONE); | 186 element->set_fill(vr_shell::Fill::NONE); |
| 184 element->set_size({kPermanentWarningWidth, kPermanentWarningHeight, 1}); | 187 element->set_size({kPermanentWarningWidth, kPermanentWarningHeight, 1}); |
| 185 element->set_scale({kWarningDistance, kWarningDistance, 1}); | 188 |
| 186 element->set_translation( | 189 cc::TransformOperations operations; |
| 187 gfx::Vector3dF(0, kWarningDistance * sin(kWarningAngleRadians), | 190 operations.AppendTranslate(0, kWarningDistance * sin(kWarningAngleRadians), |
| 188 -kWarningDistance * cos(kWarningAngleRadians))); | 191 -kWarningDistance * cos(kWarningAngleRadians)); |
| 189 element->set_rotation( | 192 operations.AppendRotate(1, 0, 0, toDegrees(kWarningAngleRadians)); |
| 190 gfx::Quaternion(gfx::Vector3dF(1, 0, 0), kWarningAngleRadians)); | 193 operations.AppendScale(kWarningDistance, kWarningDistance, 1); |
| 194 element->set_transform_operations(operations); |
| 195 |
| 191 element->set_visible(false); | 196 element->set_visible(false); |
| 192 element->set_hit_testable(false); | 197 element->set_hit_testable(false); |
| 193 element->set_lock_to_fov(true); | 198 element->set_lock_to_fov(true); |
| 194 permanent_security_warning_ = element.get(); | 199 permanent_security_warning_ = element.get(); |
| 195 scene_->AddUiElement(std::move(element)); | 200 scene_->AddUiElement(std::move(element)); |
| 196 | 201 |
| 197 auto transient_warning = base::MakeUnique<TransientSecurityWarning>( | 202 auto transient_warning = base::MakeUnique<TransientSecurityWarning>( |
| 198 1024, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds)); | 203 AllocateId(), 1024, base::TimeDelta::FromSeconds(kWarningTimeoutSeconds)); |
| 199 transient_security_warning_ = transient_warning.get(); | 204 transient_security_warning_ = transient_warning.get(); |
| 200 element = std::move(transient_warning); | 205 element = std::move(transient_warning); |
| 201 element->set_debug_id(kWebVrTransientHttpSecurityWarning); | 206 element->set_debug_id(kWebVrTransientHttpSecurityWarning); |
| 202 element->set_id(AllocateId()); | |
| 203 element->set_fill(vr_shell::Fill::NONE); | 207 element->set_fill(vr_shell::Fill::NONE); |
| 204 element->set_size({kTransientWarningWidth, kTransientWarningHeight, 1}); | 208 element->set_size({kTransientWarningWidth, kTransientWarningHeight, 1}); |
| 205 element->set_scale({kWarningDistance, kWarningDistance, 1}); | 209 operations = cc::TransformOperations(); |
| 206 element->set_translation({0, 0, -kWarningDistance}); | 210 operations.AppendTranslate(0, 0, -kWarningDistance); |
| 211 element->set_transform_operations(operations); |
| 207 element->set_visible(false); | 212 element->set_visible(false); |
| 208 element->set_hit_testable(false); | 213 element->set_hit_testable(false); |
| 209 element->set_lock_to_fov(true); | 214 element->set_lock_to_fov(true); |
| 210 scene_->AddUiElement(std::move(element)); | 215 scene_->AddUiElement(std::move(element)); |
| 211 | 216 |
| 212 element = base::MakeUnique<ExitWarning>(1024); | 217 element = base::MakeUnique<ExitWarning>(AllocateId(), 1024); |
| 213 element->set_debug_id(kExitWarning); | 218 element->set_debug_id(kExitWarning); |
| 214 element->set_id(AllocateId()); | |
| 215 element->set_fill(vr_shell::Fill::NONE); | 219 element->set_fill(vr_shell::Fill::NONE); |
| 216 element->set_size({kExitWarningWidth, kExitWarningHeight, 1}); | 220 element->set_size({kExitWarningWidth, kExitWarningHeight, 1}); |
| 217 element->set_scale({kExitWarningDistance, kExitWarningDistance, 1}); | 221 operations = cc::TransformOperations(); |
| 218 element->set_translation({0, 0, -kExitWarningDistance}); | 222 operations.AppendTranslate(0, 0, -kExitWarningDistance); |
| 223 operations.AppendScale(kExitWarningDistance, kExitWarningDistance, 1); |
| 224 element->set_transform_operations(operations); |
| 219 element->set_visible(false); | 225 element->set_visible(false); |
| 220 element->set_hit_testable(false); | 226 element->set_hit_testable(false); |
| 221 element->set_lock_to_fov(true); | 227 element->set_lock_to_fov(true); |
| 222 exit_warning_ = element.get(); | 228 exit_warning_ = element.get(); |
| 223 scene_->AddUiElement(std::move(element)); | 229 scene_->AddUiElement(std::move(element)); |
| 224 } | 230 } |
| 225 | 231 |
| 226 void UiSceneManager::CreateSystemIndicators() { | 232 void UiSceneManager::CreateSystemIndicators() { |
| 227 std::unique_ptr<UiElement> element; | 233 std::unique_ptr<UiElement> element; |
| 228 | 234 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 240 {&screen_capture_indicator_, kScreenCaptureIndicator, | 246 {&screen_capture_indicator_, kScreenCaptureIndicator, |
| 241 vector_icons::kScreenShareIcon, IDS_SCREEN_CAPTURE_NOTIFICATION_TEXT_2}, | 247 vector_icons::kScreenShareIcon, IDS_SCREEN_CAPTURE_NOTIFICATION_TEXT_2}, |
| 242 {&bluetooth_connected_indicator_, kBluetoothConnectedIndicator, | 248 {&bluetooth_connected_indicator_, kBluetoothConnectedIndicator, |
| 243 vector_icons::kBluetoothConnectedIcon, 0}, | 249 vector_icons::kBluetoothConnectedIcon, 0}, |
| 244 {&location_access_indicator_, kLocationAccessIndicator, | 250 {&location_access_indicator_, kLocationAccessIndicator, |
| 245 ui::kLocationOnIcon, 0}, | 251 ui::kLocationOnIcon, 0}, |
| 246 }; | 252 }; |
| 247 | 253 |
| 248 for (const auto& indicator : indicators) { | 254 for (const auto& indicator : indicators) { |
| 249 element = base::MakeUnique<SystemIndicator>( | 255 element = base::MakeUnique<SystemIndicator>( |
| 250 512, kIndicatorHeight, indicator.icon, indicator.resource_string); | 256 AllocateId(), 512, kIndicatorHeight, indicator.icon, |
| 257 indicator.resource_string); |
| 251 element->set_debug_id(indicator.debug_id); | 258 element->set_debug_id(indicator.debug_id); |
| 252 element->set_id(AllocateId()); | |
| 253 element->set_parent_id(main_content_->id()); | 259 element->set_parent_id(main_content_->id()); |
| 254 element->set_y_anchoring(YAnchoring::YTOP); | 260 element->set_y_anchoring(YAnchoring::YTOP); |
| 255 element->set_visible(false); | 261 element->set_visible(false); |
| 256 *(indicator.element) = element.get(); | 262 *(indicator.element) = element.get(); |
| 257 system_indicators_.push_back(element.get()); | 263 system_indicators_.push_back(element.get()); |
| 258 scene_->AddUiElement(std::move(element)); | 264 scene_->AddUiElement(std::move(element)); |
| 259 } | 265 } |
| 260 | 266 |
| 261 ConfigureIndicators(); | 267 ConfigureIndicators(); |
| 262 } | 268 } |
| 263 | 269 |
| 264 void UiSceneManager::CreateContentQuad() { | 270 void UiSceneManager::CreateContentQuad() { |
| 265 std::unique_ptr<UiElement> element; | 271 std::unique_ptr<UiElement> element; |
| 266 | 272 |
| 267 element = base::MakeUnique<UiElement>(); | 273 element = base::MakeUnique<UiElement>(AllocateId()); |
| 268 element->set_debug_id(kContentQuad); | 274 element->set_debug_id(kContentQuad); |
| 269 element->set_id(AllocateId()); | |
| 270 element->set_fill(vr_shell::Fill::CONTENT); | 275 element->set_fill(vr_shell::Fill::CONTENT); |
| 271 element->set_size({kContentWidth, kContentHeight, 1}); | 276 element->set_size({kContentWidth, kContentHeight, 1}); |
| 272 element->set_translation({0, kContentVerticalOffset, -kContentDistance}); | 277 cc::TransformOperations operations; |
| 278 operations.AppendTranslate(0, kContentVerticalOffset, -kContentDistance); |
| 279 element->set_transform_operations(operations); |
| 273 element->set_visible(false); | 280 element->set_visible(false); |
| 274 main_content_ = element.get(); | 281 main_content_ = element.get(); |
| 275 content_elements_.push_back(element.get()); | 282 content_elements_.push_back(element.get()); |
| 276 scene_->AddUiElement(std::move(element)); | 283 scene_->AddUiElement(std::move(element)); |
| 277 | 284 |
| 278 // Place an invisible but hittable plane behind the content quad, to keep the | 285 // Place an invisible but hittable plane behind the content quad, to keep the |
| 279 // reticle roughly planar with the content if near content. | 286 // reticle roughly planar with the content if near content. |
| 280 element = base::MakeUnique<UiElement>(); | 287 element = base::MakeUnique<UiElement>(AllocateId()); |
| 281 element->set_debug_id(kBackplane); | 288 element->set_debug_id(kBackplane); |
| 282 element->set_id(AllocateId()); | |
| 283 element->set_fill(vr_shell::Fill::NONE); | 289 element->set_fill(vr_shell::Fill::NONE); |
| 284 element->set_size({kBackplaneSize, kBackplaneSize, 1.0}); | 290 element->set_size({kBackplaneSize, kBackplaneSize, 1.0}); |
| 285 element->set_translation({0.0, 0.0, -kTextureOffset}); | 291 operations = cc::TransformOperations(); |
| 292 operations.AppendTranslate(0, 0, -kTextureOffset); |
| 293 element->set_transform_operations(operations); |
| 286 element->set_parent_id(main_content_->id()); | 294 element->set_parent_id(main_content_->id()); |
| 287 content_elements_.push_back(element.get()); | 295 content_elements_.push_back(element.get()); |
| 288 scene_->AddUiElement(std::move(element)); | 296 scene_->AddUiElement(std::move(element)); |
| 289 | 297 |
| 290 // Limit reticle distance to a sphere based on content distance. | 298 // Limit reticle distance to a sphere based on content distance. |
| 291 scene_->SetBackgroundDistance(main_content_->translation().z() * | 299 scene_->SetBackgroundDistance( |
| 292 -kBackgroundDistanceMultiplier); | 300 main_content_->transform_operations().Apply().matrix().get(2, 3) * |
| 301 -kBackgroundDistanceMultiplier); |
| 293 } | 302 } |
| 294 | 303 |
| 295 void UiSceneManager::CreateSplashScreen() { | 304 void UiSceneManager::CreateSplashScreen() { |
| 296 // Chrome icon. | 305 // Chrome icon. |
| 297 std::unique_ptr<SplashScreenIcon> icon = | 306 std::unique_ptr<SplashScreenIcon> icon = |
| 298 base::MakeUnique<SplashScreenIcon>(256); | 307 base::MakeUnique<SplashScreenIcon>(AllocateId(), 256); |
| 299 icon->set_debug_id(kSplashScreenIcon); | 308 icon->set_debug_id(kSplashScreenIcon); |
| 300 icon->set_id(AllocateId()); | |
| 301 icon->set_hit_testable(false); | 309 icon->set_hit_testable(false); |
| 302 icon->set_size({kSplashScreenIconWidth, kSplashScreenIconHeight, 1.0}); | 310 icon->set_size({kSplashScreenIconWidth, kSplashScreenIconHeight, 1.0}); |
| 303 icon->set_translation( | 311 cc::TransformOperations operations; |
| 304 {0, kSplashScreenIconVerticalOffset, -kSplashScreenDistance}); | 312 operations.AppendTranslate(0, kSplashScreenIconVerticalOffset, |
| 313 -kSplashScreenDistance); |
| 314 icon->set_transform_operations(operations); |
| 305 splash_screen_icon_ = icon.get(); | 315 splash_screen_icon_ = icon.get(); |
| 306 scene_->AddUiElement(std::move(icon)); | 316 scene_->AddUiElement(std::move(icon)); |
| 307 } | 317 } |
| 308 | 318 |
| 309 void UiSceneManager::CreateBackground() { | 319 void UiSceneManager::CreateBackground() { |
| 310 std::unique_ptr<UiElement> element; | 320 std::unique_ptr<UiElement> element; |
| 311 | 321 |
| 312 // Floor. | 322 // Floor. |
| 313 element = base::MakeUnique<UiElement>(); | 323 element = base::MakeUnique<UiElement>(AllocateId()); |
| 314 element->set_debug_id(kFloor); | 324 element->set_debug_id(kFloor); |
| 315 element->set_id(AllocateId()); | |
| 316 element->set_size({kSceneSize, kSceneSize, 1.0}); | 325 element->set_size({kSceneSize, kSceneSize, 1.0}); |
| 317 element->set_translation({0.0, -kSceneHeight / 2, 0.0}); | 326 cc::TransformOperations operations; |
| 318 element->set_rotation(gfx::Quaternion(gfx::Vector3dF(1, 0, 0), -M_PI / 2)); | 327 operations.AppendTranslate(0.0, -kSceneHeight / 2, 0.0); |
| 328 operations.AppendRotate(1, 0, 0, -90); |
| 329 element->set_transform_operations(operations); |
| 319 element->set_fill(vr_shell::Fill::GRID_GRADIENT); | 330 element->set_fill(vr_shell::Fill::GRID_GRADIENT); |
| 320 element->set_draw_phase(0); | 331 element->set_draw_phase(0); |
| 321 element->set_gridline_count(kFloorGridlineCount); | 332 element->set_gridline_count(kFloorGridlineCount); |
| 322 floor_ = element.get(); | 333 floor_ = element.get(); |
| 323 background_elements_.push_back(element.get()); | 334 background_elements_.push_back(element.get()); |
| 324 scene_->AddUiElement(std::move(element)); | 335 scene_->AddUiElement(std::move(element)); |
| 325 | 336 |
| 326 // Ceiling. | 337 // Ceiling. |
| 327 element = base::MakeUnique<UiElement>(); | 338 element = base::MakeUnique<UiElement>(AllocateId()); |
| 328 element->set_debug_id(kCeiling); | 339 element->set_debug_id(kCeiling); |
| 329 element->set_id(AllocateId()); | |
| 330 element->set_size({kSceneSize, kSceneSize, 1.0}); | 340 element->set_size({kSceneSize, kSceneSize, 1.0}); |
| 331 element->set_translation({0.0, kSceneHeight / 2, 0.0}); | 341 operations = cc::TransformOperations(); |
| 332 element->set_rotation(gfx::Quaternion(gfx::Vector3dF(1, 0, 0), M_PI / 2)); | 342 operations.AppendTranslate(0.0, kSceneHeight / 2, 0.0); |
| 343 operations.AppendRotate(1, 0, 0, 90); |
| 344 element->set_transform_operations(operations); |
| 333 element->set_fill(vr_shell::Fill::OPAQUE_GRADIENT); | 345 element->set_fill(vr_shell::Fill::OPAQUE_GRADIENT); |
| 334 element->set_draw_phase(0); | 346 element->set_draw_phase(0); |
| 335 ceiling_ = element.get(); | 347 ceiling_ = element.get(); |
| 336 background_elements_.push_back(element.get()); | 348 background_elements_.push_back(element.get()); |
| 337 scene_->AddUiElement(std::move(element)); | 349 scene_->AddUiElement(std::move(element)); |
| 338 | 350 |
| 339 UpdateBackgroundColor(); | 351 UpdateBackgroundColor(); |
| 340 } | 352 } |
| 341 | 353 |
| 342 void UiSceneManager::CreateUrlBar() { | 354 void UiSceneManager::CreateUrlBar() { |
| 343 // TODO(cjgrant): Incorporate final size and position. | 355 // TODO(cjgrant): Incorporate final size and position. |
| 344 auto url_bar = base::MakeUnique<UrlBar>( | 356 auto url_bar = base::MakeUnique<UrlBar>( |
| 345 512, | 357 AllocateId(), 512, |
| 346 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this)), | 358 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this)), |
| 347 base::Bind(&UiSceneManager::OnSecurityIconClicked, | 359 base::Bind(&UiSceneManager::OnSecurityIconClicked, |
| 348 base::Unretained(this)), | 360 base::Unretained(this)), |
| 349 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this))); | 361 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this))); |
| 350 url_bar->set_debug_id(kUrlBar); | 362 url_bar->set_debug_id(kUrlBar); |
| 351 url_bar->set_id(AllocateId()); | 363 cc::TransformOperations operations; |
| 352 url_bar->set_translation({0, kUrlBarVerticalOffset, -kUrlBarDistance}); | 364 operations.AppendTranslate(0, kUrlBarVerticalOffset, -kUrlBarDistance); |
| 353 url_bar->set_rotation( | 365 operations.AppendRotate(1, 0, 0, toDegrees(kUrlBarRotationRad)); |
| 354 gfx::Quaternion(gfx::Vector3dF(1, 0, 0), kUrlBarRotationRad)); | 366 url_bar->set_transform_operations(operations); |
| 355 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1}); | 367 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1}); |
| 356 url_bar_ = url_bar.get(); | 368 url_bar_ = url_bar.get(); |
| 357 control_elements_.push_back(url_bar.get()); | 369 control_elements_.push_back(url_bar.get()); |
| 358 scene_->AddUiElement(std::move(url_bar)); | 370 scene_->AddUiElement(std::move(url_bar)); |
| 359 | 371 |
| 360 auto indicator = base::MakeUnique<LoadingIndicator>(256); | 372 auto indicator = base::MakeUnique<LoadingIndicator>(AllocateId(), 256); |
| 361 indicator->set_debug_id(kLoadingIndicator); | 373 indicator->set_debug_id(kLoadingIndicator); |
| 362 indicator->set_id(AllocateId()); | 374 operations = cc::TransformOperations(); |
| 363 indicator->set_translation( | 375 operations.AppendTranslate(0, kLoadingIndicatorVerticalOffset, |
| 364 {0, kLoadingIndicatorVerticalOffset, kLoadingIndicatorDepthOffset}); | 376 kLoadingIndicatorDepthOffset); |
| 377 indicator->set_transform_operations(operations); |
| 365 indicator->set_size({kLoadingIndicatorWidth, kLoadingIndicatorHeight, 1}); | 378 indicator->set_size({kLoadingIndicatorWidth, kLoadingIndicatorHeight, 1}); |
| 366 indicator->set_parent_id(url_bar_->id()); | 379 indicator->set_parent_id(url_bar_->id()); |
| 367 indicator->set_y_anchoring(YAnchoring::YTOP); | 380 indicator->set_y_anchoring(YAnchoring::YTOP); |
| 368 loading_indicator_ = indicator.get(); | 381 loading_indicator_ = indicator.get(); |
| 369 control_elements_.push_back(indicator.get()); | 382 control_elements_.push_back(indicator.get()); |
| 370 scene_->AddUiElement(std::move(indicator)); | 383 scene_->AddUiElement(std::move(indicator)); |
| 371 } | 384 } |
| 372 | 385 |
| 373 void UiSceneManager::CreateTransientUrlBar() { | 386 void UiSceneManager::CreateTransientUrlBar() { |
| 374 auto url_bar = base::MakeUnique<TransientUrlBar>( | 387 auto url_bar = base::MakeUnique<TransientUrlBar>( |
| 375 512, base::TimeDelta::FromSeconds(kTransientUrlBarTimeoutSeconds), | 388 AllocateId(), 512, |
| 389 base::TimeDelta::FromSeconds(kTransientUrlBarTimeoutSeconds), |
| 376 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this))); | 390 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this))); |
| 377 url_bar->set_debug_id(kTransientUrlBar); | 391 url_bar->set_debug_id(kTransientUrlBar); |
| 378 url_bar->set_id(AllocateId()); | |
| 379 url_bar->set_lock_to_fov(true); | 392 url_bar->set_lock_to_fov(true); |
| 380 url_bar->set_visible(false); | 393 url_bar->set_visible(false); |
| 381 url_bar->set_hit_testable(false); | 394 url_bar->set_hit_testable(false); |
| 382 url_bar->set_translation( | 395 cc::TransformOperations operations; |
| 383 {0, kTransientUrlBarVerticalOffset, -kTransientUrlBarDistance}); | 396 operations.AppendTranslate(0, kTransientUrlBarVerticalOffset, |
| 384 url_bar->set_rotation( | 397 -kTransientUrlBarDistance); |
| 385 gfx::Quaternion(gfx::Vector3dF(1, 0, 0), kUrlBarRotationRad)); | 398 operations.AppendRotate(1, 0, 0, toDegrees(kUrlBarRotationRad)); |
| 399 url_bar->set_transform_operations(operations); |
| 386 url_bar->set_size({kTransientUrlBarWidth, kTransientUrlBarHeight, 1}); | 400 url_bar->set_size({kTransientUrlBarWidth, kTransientUrlBarHeight, 1}); |
| 387 transient_url_bar_ = url_bar.get(); | 401 transient_url_bar_ = url_bar.get(); |
| 388 scene_->AddUiElement(std::move(url_bar)); | 402 scene_->AddUiElement(std::move(url_bar)); |
| 389 } | 403 } |
| 390 | 404 |
| 391 void UiSceneManager::CreateCloseButton() { | 405 void UiSceneManager::CreateCloseButton() { |
| 392 std::unique_ptr<Button> element = base::MakeUnique<Button>( | 406 std::unique_ptr<Button> element = base::MakeUnique<Button>( |
| 407 AllocateId(), |
| 393 base::Bind(&UiSceneManager::OnCloseButtonClicked, base::Unretained(this)), | 408 base::Bind(&UiSceneManager::OnCloseButtonClicked, base::Unretained(this)), |
| 394 base::MakeUnique<CloseButtonTexture>()); | 409 base::MakeUnique<CloseButtonTexture>()); |
| 395 element->set_debug_id(kCloseButton); | 410 element->set_debug_id(kCloseButton); |
| 396 element->set_id(AllocateId()); | |
| 397 element->set_fill(vr_shell::Fill::NONE); | 411 element->set_fill(vr_shell::Fill::NONE); |
| 398 element->set_translation( | 412 cc::TransformOperations operations; |
| 399 gfx::Vector3dF(0, kContentVerticalOffset - (kContentHeight / 2) - 0.3, | 413 operations.AppendTranslate( |
| 400 -kCloseButtonDistance)); | 414 0, kContentVerticalOffset - (kContentHeight / 2) - 0.3, |
| 415 -kCloseButtonDistance); |
| 416 element->set_transform_operations(operations); |
| 401 element->set_size(gfx::Vector3dF(kCloseButtonWidth, kCloseButtonHeight, 1)); | 417 element->set_size(gfx::Vector3dF(kCloseButtonWidth, kCloseButtonHeight, 1)); |
| 402 close_button_ = element.get(); | 418 close_button_ = element.get(); |
| 403 scene_->AddUiElement(std::move(element)); | 419 scene_->AddUiElement(std::move(element)); |
| 404 } | 420 } |
| 405 | 421 |
| 406 void UiSceneManager::CreateExitPrompt() { | 422 void UiSceneManager::CreateExitPrompt() { |
| 407 std::unique_ptr<UiElement> element = base::MakeUnique<ExitPrompt>( | 423 std::unique_ptr<UiElement> element = base::MakeUnique<ExitPrompt>( |
| 408 512, | 424 AllocateId(), 512, |
| 409 base::Bind(&UiSceneManager::OnExitPromptPrimaryButtonClicked, | 425 base::Bind(&UiSceneManager::OnExitPromptPrimaryButtonClicked, |
| 410 base::Unretained(this)), | 426 base::Unretained(this)), |
| 411 base::Bind(&UiSceneManager::OnExitPromptSecondaryButtonClicked, | 427 base::Bind(&UiSceneManager::OnExitPromptSecondaryButtonClicked, |
| 412 base::Unretained(this))); | 428 base::Unretained(this))); |
| 413 element->set_debug_id(kExitPrompt); | 429 element->set_debug_id(kExitPrompt); |
| 414 element->set_id(AllocateId()); | |
| 415 element->set_fill(vr_shell::Fill::NONE); | 430 element->set_fill(vr_shell::Fill::NONE); |
| 416 element->set_size({kExitPromptWidth, kExitPromptHeight, 1}); | 431 element->set_size({kExitPromptWidth, kExitPromptHeight, 1}); |
| 417 element->set_translation({0.0, kExitPromptVerticalOffset, kTextureOffset}); | 432 cc::TransformOperations operations; |
| 433 operations.AppendTranslate(0.0, kExitPromptVerticalOffset, kTextureOffset); |
| 434 element->set_transform_operations(operations); |
| 418 element->set_parent_id(main_content_->id()); | 435 element->set_parent_id(main_content_->id()); |
| 419 element->set_visible(false); | 436 element->set_visible(false); |
| 420 exit_prompt_ = element.get(); | 437 exit_prompt_ = element.get(); |
| 421 scene_->AddUiElement(std::move(element)); | 438 scene_->AddUiElement(std::move(element)); |
| 422 | 439 |
| 423 // Place an invisible but hittable plane behind the exit prompt, to keep the | 440 // Place an invisible but hittable plane behind the exit prompt, to keep the |
| 424 // reticle roughly planar with the content if near content. | 441 // reticle roughly planar with the content if near content. |
| 425 element = base::MakeUnique<ExitPromptBackplane>(base::Bind( | 442 element = base::MakeUnique<ExitPromptBackplane>( |
| 426 &UiSceneManager::OnExitPromptBackplaneClicked, base::Unretained(this))); | 443 AllocateId(), base::Bind(&UiSceneManager::OnExitPromptBackplaneClicked, |
| 444 base::Unretained(this))); |
| 427 element->set_debug_id(kExitPromptBackplane); | 445 element->set_debug_id(kExitPromptBackplane); |
| 428 element->set_id(AllocateId()); | |
| 429 element->set_fill(vr_shell::Fill::NONE); | 446 element->set_fill(vr_shell::Fill::NONE); |
| 430 element->set_size({kExitPromptBackplaneSize, kExitPromptBackplaneSize, 1.0}); | 447 element->set_size({kExitPromptBackplaneSize, kExitPromptBackplaneSize, 1.0}); |
| 431 element->set_translation({0.0, 0.0, -kTextureOffset}); | 448 operations = cc::TransformOperations(); |
| 449 operations.AppendTranslate(0.0, 0.0, -kTextureOffset); |
| 450 element->set_transform_operations(operations); |
| 432 element->set_parent_id(exit_prompt_->id()); | 451 element->set_parent_id(exit_prompt_->id()); |
| 433 exit_prompt_backplane_ = element.get(); | 452 exit_prompt_backplane_ = element.get(); |
| 434 content_elements_.push_back(element.get()); | 453 content_elements_.push_back(element.get()); |
| 435 scene_->AddUiElement(std::move(element)); | 454 scene_->AddUiElement(std::move(element)); |
| 436 } | 455 } |
| 437 | 456 |
| 438 void UiSceneManager::CreateToasts() { | 457 void UiSceneManager::CreateToasts() { |
| 439 auto element = base::MakeUnique<ExclusiveScreenToast>( | 458 auto element = base::MakeUnique<ExclusiveScreenToast>( |
| 440 512, base::TimeDelta::FromSeconds(kToastTimeoutSeconds)); | 459 AllocateId(), 512, base::TimeDelta::FromSeconds(kToastTimeoutSeconds)); |
| 441 element->set_debug_id(kExclusiveScreenToast); | 460 element->set_debug_id(kExclusiveScreenToast); |
| 442 element->set_id(AllocateId()); | |
| 443 element->set_fill(vr_shell::Fill::NONE); | 461 element->set_fill(vr_shell::Fill::NONE); |
| 444 element->set_size({kToastWidthDMM, kToastHeightDMM, 1}); | 462 element->set_size({kToastWidthDMM, kToastHeightDMM, 1}); |
| 445 element->set_visible(false); | 463 element->set_visible(false); |
| 446 element->set_hit_testable(false); | 464 element->set_hit_testable(false); |
| 447 exclusive_screen_toast_ = element.get(); | 465 exclusive_screen_toast_ = element.get(); |
| 448 scene_->AddUiElement(std::move(element)); | 466 scene_->AddUiElement(std::move(element)); |
| 449 } | 467 } |
| 450 | 468 |
| 451 base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() { | 469 base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() { |
| 452 return weak_ptr_factory_.GetWeakPtr(); | 470 return weak_ptr_factory_.GetWeakPtr(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 } | 524 } |
| 507 | 525 |
| 508 // Exit prompt. | 526 // Exit prompt. |
| 509 bool showExitPrompt = browsing_mode && scene_->is_prompting_to_exit(); | 527 bool showExitPrompt = browsing_mode && scene_->is_prompting_to_exit(); |
| 510 exit_prompt_->SetEnabled(showExitPrompt); | 528 exit_prompt_->SetEnabled(showExitPrompt); |
| 511 exit_prompt_backplane_->SetEnabled(showExitPrompt); | 529 exit_prompt_backplane_->SetEnabled(showExitPrompt); |
| 512 | 530 |
| 513 // Update content quad parameters depending on fullscreen. | 531 // Update content quad parameters depending on fullscreen. |
| 514 // TODO(http://crbug.com/642937): Animate fullscreen transitions. | 532 // TODO(http://crbug.com/642937): Animate fullscreen transitions. |
| 515 if (fullscreen_) { | 533 if (fullscreen_) { |
| 516 main_content_->set_translation( | 534 cc::TransformOperations operations; |
| 517 {0, kFullscreenVerticalOffset, -kFullscreenDistance}); | 535 operations.AppendTranslate(0, kFullscreenVerticalOffset, |
| 536 -kFullscreenDistance); |
| 537 main_content_->set_transform_operations(operations); |
| 518 main_content_->set_size({kFullscreenWidth, kFullscreenHeight, 1}); | 538 main_content_->set_size({kFullscreenWidth, kFullscreenHeight, 1}); |
| 519 | 539 |
| 520 close_button_->set_translation(gfx::Vector3dF( | 540 operations = cc::TransformOperations(); |
| 541 operations.AppendTranslate( |
| 521 0, kFullscreenVerticalOffset - (kFullscreenHeight / 2) - 0.35, | 542 0, kFullscreenVerticalOffset - (kFullscreenHeight / 2) - 0.35, |
| 522 -kCloseButtonFullscreenDistance)); | 543 -kCloseButtonFullscreenDistance); |
| 544 close_button_->set_transform_operations(operations); |
| 523 close_button_->set_size(gfx::Vector3dF(kCloseButtonFullscreenWidth, | 545 close_button_->set_size(gfx::Vector3dF(kCloseButtonFullscreenWidth, |
| 524 kCloseButtonFullscreenHeight, 1)); | 546 kCloseButtonFullscreenHeight, 1)); |
| 525 } else { | 547 } else { |
| 548 cc::TransformOperations operations; |
| 549 operations.AppendTranslate(0, kContentVerticalOffset, -kContentDistance); |
| 526 // Note that main_content_ is already visible in this case. | 550 // Note that main_content_ is already visible in this case. |
| 527 main_content_->set_translation( | 551 main_content_->set_transform_operations(operations); |
| 528 {0, kContentVerticalOffset, -kContentDistance}); | |
| 529 main_content_->set_size({kContentWidth, kContentHeight, 1}); | 552 main_content_->set_size({kContentWidth, kContentHeight, 1}); |
| 530 | 553 |
| 531 close_button_->set_translation( | 554 operations = cc::TransformOperations(); |
| 532 gfx::Vector3dF(0, kContentVerticalOffset - (kContentHeight / 2) - 0.3, | 555 operations.AppendTranslate( |
| 533 -kCloseButtonDistance)); | 556 0, kContentVerticalOffset - (kContentHeight / 2) - 0.3, |
| 557 -kCloseButtonDistance); |
| 558 close_button_->set_transform_operations(operations); |
| 534 close_button_->set_size( | 559 close_button_->set_size( |
| 535 gfx::Vector3dF(kCloseButtonWidth, kCloseButtonHeight, 1)); | 560 gfx::Vector3dF(kCloseButtonWidth, kCloseButtonHeight, 1)); |
| 536 } | 561 } |
| 537 | 562 |
| 538 scene_->SetMode(mode()); | 563 scene_->SetMode(mode()); |
| 539 scene_->SetBackgroundDistance(main_content_->translation().z() * | 564 scene_->SetBackgroundDistance( |
| 540 -kBackgroundDistanceMultiplier); | 565 main_content_->transform_operations().Apply().matrix().get(2, 3) * |
| 566 -kBackgroundDistanceMultiplier); |
| 541 UpdateBackgroundColor(); | 567 UpdateBackgroundColor(); |
| 542 | 568 |
| 543 transient_url_bar_->SetEnabled(web_vr_autopresentation_ && | 569 transient_url_bar_->SetEnabled(web_vr_autopresentation_ && |
| 544 !scene_->showing_splash_screen()); | 570 !scene_->showing_splash_screen()); |
| 545 | 571 |
| 546 ConfigureExclusiveScreenToast(); | 572 ConfigureExclusiveScreenToast(); |
| 547 ConfigureSecurityWarnings(); | 573 ConfigureSecurityWarnings(); |
| 548 ConfigureIndicators(); | 574 ConfigureIndicators(); |
| 549 } | 575 } |
| 550 | 576 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 video_capture_indicator_->set_visible(allowed && video_capturing_); | 662 video_capture_indicator_->set_visible(allowed && video_capturing_); |
| 637 screen_capture_indicator_->set_visible(allowed && screen_capturing_); | 663 screen_capture_indicator_->set_visible(allowed && screen_capturing_); |
| 638 location_access_indicator_->set_visible(allowed && location_access_); | 664 location_access_indicator_->set_visible(allowed && location_access_); |
| 639 bluetooth_connected_indicator_->set_visible(allowed && bluetooth_connected_); | 665 bluetooth_connected_indicator_->set_visible(allowed && bluetooth_connected_); |
| 640 | 666 |
| 641 if (!allowed) | 667 if (!allowed) |
| 642 return; | 668 return; |
| 643 | 669 |
| 644 // Position elements dynamically relative to each other, based on which | 670 // Position elements dynamically relative to each other, based on which |
| 645 // indicators are showing, and how big each one is. | 671 // indicators are showing, and how big each one is. |
| 672 // TODO(vollick): create a linear layout element to own this logic. |
| 646 float total_width = 0; | 673 float total_width = 0; |
| 647 for (const UiElement* indicator : system_indicators_) { | 674 for (const UiElement* indicator : system_indicators_) { |
| 648 if (indicator->visible()) { | 675 if (indicator->visible()) { |
| 649 if (total_width > 0) | 676 if (total_width > 0) |
| 650 total_width += kIndicatorGap; | 677 total_width += kIndicatorGap; |
| 651 total_width += indicator->size().x(); | 678 total_width += indicator->size().x(); |
| 652 } | 679 } |
| 653 } | 680 } |
| 654 float x_position = -total_width / 2; | 681 float x_position = -total_width / 2; |
| 655 for (UiElement* indicator : system_indicators_) { | 682 for (UiElement* indicator : system_indicators_) { |
| 656 if (!indicator->visible()) | 683 if (!indicator->visible()) |
| 657 continue; | 684 continue; |
| 658 float width = indicator->size().x(); | 685 float width = indicator->size().x(); |
| 659 indicator->set_translation({x_position + width / 2, | 686 cc::TransformOperations operations; |
| 660 kIndicatorVerticalOffset, | 687 operations.AppendTranslate(x_position + width / 2, kIndicatorVerticalOffset, |
| 661 kIndicatorDistanceOffset}); | 688 kIndicatorDistanceOffset); |
| 689 indicator->set_transform_operations(operations); |
| 662 x_position += width + kIndicatorGap; | 690 x_position += width + kIndicatorGap; |
| 663 } | 691 } |
| 664 } | 692 } |
| 665 | 693 |
| 666 void UiSceneManager::ConfigureExclusiveScreenToast() { | 694 void UiSceneManager::ConfigureExclusiveScreenToast() { |
| 667 exclusive_screen_toast_->SetEnabled((fullscreen_ && !web_vr_mode_) || | 695 exclusive_screen_toast_->SetEnabled((fullscreen_ && !web_vr_mode_) || |
| 668 (web_vr_mode_ && web_vr_show_toast_)); | 696 (web_vr_mode_ && web_vr_show_toast_)); |
| 669 | 697 |
| 670 if (fullscreen_ && !web_vr_mode_) { | 698 if (fullscreen_ && !web_vr_mode_) { |
| 671 // Do not set size again. The size might have been changed by the backing | 699 // Do not set size again. The size might have been changed by the backing |
| 672 // texture size in UpdateElementSize. | 700 // texture size in UpdateElementSize. |
| 673 exclusive_screen_toast_->set_scale( | 701 cc::TransformOperations operations; |
| 674 {kFullscreenToastDistance, kFullscreenToastDistance, 1}); | 702 operations.AppendTranslate( |
| 675 exclusive_screen_toast_->set_translation( | 703 0, |
| 676 {0, | 704 kFullscreenVerticalOffset + kFullscreenHeight / 2 + |
| 677 kFullscreenVerticalOffset + kFullscreenHeight / 2 + | 705 (kToastOffsetDMM + kToastHeightDMM) * kFullscreenToastDistance, |
| 678 (kToastOffsetDMM + kToastHeightDMM) * kFullscreenToastDistance, | 706 -kFullscreenToastDistance); |
| 679 -kFullscreenToastDistance}); | 707 operations.AppendScale(kFullscreenToastDistance, kFullscreenToastDistance, |
| 680 exclusive_screen_toast_->set_rotation( | 708 1); |
| 681 gfx::Quaternion(gfx::Vector3dF(1, 0, 0), 0.0)); | 709 exclusive_screen_toast_->set_transform_operations(operations); |
| 682 exclusive_screen_toast_->set_lock_to_fov(false); | 710 exclusive_screen_toast_->set_lock_to_fov(false); |
| 683 } else if (web_vr_mode_ && web_vr_show_toast_) { | 711 } else if (web_vr_mode_ && web_vr_show_toast_) { |
| 684 exclusive_screen_toast_->set_scale( | 712 cc::TransformOperations operations; |
| 685 {kWebVrToastDistance, kWebVrToastDistance, 1}); | 713 operations.AppendTranslate(0, kWebVrToastDistance * sin(kWebVrAngleRadians), |
| 686 exclusive_screen_toast_->set_translation( | 714 -kWebVrToastDistance * cos(kWebVrAngleRadians)); |
| 687 gfx::Vector3dF(0, kWebVrToastDistance * sin(kWebVrAngleRadians), | 715 operations.AppendRotate(1, 0, 0, toDegrees(kWebVrAngleRadians)); |
| 688 -kWebVrToastDistance * cos(kWebVrAngleRadians))); | 716 operations.AppendScale(kWebVrToastDistance, kWebVrToastDistance, 1); |
| 689 exclusive_screen_toast_->set_rotation( | 717 exclusive_screen_toast_->set_transform_operations(operations); |
| 690 gfx::Quaternion(gfx::Vector3dF(1, 0, 0), kWebVrAngleRadians)); | |
| 691 exclusive_screen_toast_->set_lock_to_fov(true); | 718 exclusive_screen_toast_->set_lock_to_fov(true); |
| 692 } | 719 } |
| 693 } | 720 } |
| 694 | 721 |
| 695 void UiSceneManager::OnBackButtonClicked() { | 722 void UiSceneManager::OnBackButtonClicked() { |
| 696 browser_->NavigateBack(); | 723 browser_->NavigateBack(); |
| 697 } | 724 } |
| 698 | 725 |
| 699 void UiSceneManager::OnSecurityIconClickedForTesting() { | 726 void UiSceneManager::OnSecurityIconClickedForTesting() { |
| 700 OnSecurityIconClicked(); | 727 OnSecurityIconClicked(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 if (fullscreen_) | 805 if (fullscreen_) |
| 779 return ColorScheme::kModeFullscreen; | 806 return ColorScheme::kModeFullscreen; |
| 780 return ColorScheme::kModeNormal; | 807 return ColorScheme::kModeNormal; |
| 781 } | 808 } |
| 782 | 809 |
| 783 const ColorScheme& UiSceneManager::color_scheme() const { | 810 const ColorScheme& UiSceneManager::color_scheme() const { |
| 784 return ColorScheme::GetColorScheme(mode()); | 811 return ColorScheme::GetColorScheme(mode()); |
| 785 } | 812 } |
| 786 | 813 |
| 787 } // namespace vr_shell | 814 } // namespace vr_shell |
| OLD | NEW |