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

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

Issue 2902393002: [vr] Bail on unhandled code points. (Closed)
Patch Set: . 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 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 ConfigureScene(); 451 ConfigureScene();
450 } 452 }
451 453
452 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, 454 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back,
453 bool can_go_forward) {} 455 bool can_go_forward) {}
454 456
455 void UiSceneManager::OnCloseButtonClicked() { 457 void UiSceneManager::OnCloseButtonClicked() {
456 browser_->ExitCct(); 458 browser_->ExitCct();
457 } 459 }
458 460
461 void UiSceneManager::OnUnsupportedMode(UiUnsupportedMode mode) {
462 browser_->OnUnsupportedMode(mode);
463 }
464
459 int UiSceneManager::AllocateId() { 465 int UiSceneManager::AllocateId() {
460 return next_available_id_++; 466 return next_available_id_++;
461 } 467 }
462 468
463 const ColorScheme& UiSceneManager::color_scheme() const { 469 const ColorScheme& UiSceneManager::color_scheme() const {
464 return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen 470 return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen
465 : ColorScheme::kModeNormal); 471 : ColorScheme::kModeNormal);
466 } 472 }
467 473
468 } // namespace vr_shell 474 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698