| 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/color_scheme.h" | 9 #include "chrome/browser/android/vr_shell/color_scheme.h" |
| 10 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" | 10 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 element->set_draw_phase(0); | 264 element->set_draw_phase(0); |
| 265 floor_grid_ = element.get(); | 265 floor_grid_ = element.get(); |
| 266 content_elements_.push_back(element.get()); | 266 content_elements_.push_back(element.get()); |
| 267 scene_->AddUiElement(std::move(element)); | 267 scene_->AddUiElement(std::move(element)); |
| 268 | 268 |
| 269 UpdateBackgroundColor(); | 269 UpdateBackgroundColor(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void UiSceneManager::CreateUrlBar() { | 272 void UiSceneManager::CreateUrlBar() { |
| 273 // TODO(cjgrant): Incorporate final size and position. | 273 // TODO(cjgrant): Incorporate final size and position. |
| 274 auto url_bar = base::MakeUnique<UrlBar>(512); | 274 auto url_bar = base::MakeUnique<UrlBar>( |
| 275 512, |
| 276 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this))); |
| 275 url_bar->set_debug_id(kUrlBar); | 277 url_bar->set_debug_id(kUrlBar); |
| 276 url_bar->set_id(AllocateId()); | 278 url_bar->set_id(AllocateId()); |
| 277 url_bar->set_translation({0, kUrlBarVerticalOffset, -kUrlBarDistance}); | 279 url_bar->set_translation({0, kUrlBarVerticalOffset, -kUrlBarDistance}); |
| 278 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1}); | 280 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1}); |
| 279 url_bar->SetBackButtonCallback( | 281 url_bar->SetBackButtonCallback( |
| 280 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this))); | 282 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this))); |
| 281 url_bar_ = url_bar.get(); | 283 url_bar_ = url_bar.get(); |
| 282 control_elements_.push_back(url_bar.get()); | 284 control_elements_.push_back(url_bar.get()); |
| 283 scene_->AddUiElement(std::move(url_bar)); | 285 scene_->AddUiElement(std::move(url_bar)); |
| 284 | 286 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 ConfigureScene(); | 444 ConfigureScene(); |
| 443 } | 445 } |
| 444 | 446 |
| 445 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, | 447 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, |
| 446 bool can_go_forward) {} | 448 bool can_go_forward) {} |
| 447 | 449 |
| 448 void UiSceneManager::OnCloseButtonClicked() { | 450 void UiSceneManager::OnCloseButtonClicked() { |
| 449 browser_->ExitCct(); | 451 browser_->ExitCct(); |
| 450 } | 452 } |
| 451 | 453 |
| 454 void UiSceneManager::OnUnsupportedMode(UiUnsupportedMode mode) { |
| 455 browser_->OnUnsupportedMode(mode); |
| 456 } |
| 457 |
| 452 int UiSceneManager::AllocateId() { | 458 int UiSceneManager::AllocateId() { |
| 453 return next_available_id_++; | 459 return next_available_id_++; |
| 454 } | 460 } |
| 455 | 461 |
| 456 const ColorScheme& UiSceneManager::color_scheme() const { | 462 const ColorScheme& UiSceneManager::color_scheme() const { |
| 457 return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen | 463 return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen |
| 458 : ColorScheme::kModeNormal); | 464 : ColorScheme::kModeNormal); |
| 459 } | 465 } |
| 460 | 466 |
| 461 } // namespace vr_shell | 467 } // namespace vr_shell |
| OLD | NEW |