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

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

Issue 2902393002: [vr] Bail on unhandled code points. (Closed)
Patch Set: histograms 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/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"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 element->set_draw_phase(0); 275 element->set_draw_phase(0);
276 floor_grid_ = element.get(); 276 floor_grid_ = element.get();
277 content_elements_.push_back(element.get()); 277 content_elements_.push_back(element.get());
278 scene_->AddUiElement(std::move(element)); 278 scene_->AddUiElement(std::move(element));
279 279
280 scene_->SetBackgroundColor(kBackgroundHorizonColor); 280 scene_->SetBackgroundColor(kBackgroundHorizonColor);
281 } 281 }
282 282
283 void UiSceneManager::CreateUrlBar() { 283 void UiSceneManager::CreateUrlBar() {
284 // TODO(cjgrant): Incorporate final size and position. 284 // TODO(cjgrant): Incorporate final size and position.
285 auto url_bar = base::MakeUnique<UrlBar>(512); 285 auto url_bar = base::MakeUnique<UrlBar>(
286 512,
287 base::Bind(&UiSceneManager::OnUnsupportedMode, base::Unretained(this)));
286 url_bar->set_debug_id(kUrlBar); 288 url_bar->set_debug_id(kUrlBar);
287 url_bar->set_id(AllocateId()); 289 url_bar->set_id(AllocateId());
288 url_bar->set_translation({0, kUrlBarVerticalOffset, -kUrlBarDistance}); 290 url_bar->set_translation({0, kUrlBarVerticalOffset, -kUrlBarDistance});
289 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1}); 291 url_bar->set_size({kUrlBarWidth, kUrlBarHeight, 1});
290 url_bar->SetBackButtonCallback( 292 url_bar->SetBackButtonCallback(
291 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this))); 293 base::Bind(&UiSceneManager::OnBackButtonClicked, base::Unretained(this)));
292 url_bar_ = url_bar.get(); 294 url_bar_ = url_bar.get();
293 control_elements_.push_back(url_bar.get()); 295 control_elements_.push_back(url_bar.get());
294 scene_->AddUiElement(std::move(url_bar)); 296 scene_->AddUiElement(std::move(url_bar));
295 297
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 ConfigureScene(); 460 ConfigureScene();
459 } 461 }
460 462
461 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, 463 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back,
462 bool can_go_forward) {} 464 bool can_go_forward) {}
463 465
464 void UiSceneManager::OnCloseButtonClicked() { 466 void UiSceneManager::OnCloseButtonClicked() {
465 browser_->ExitCct(); 467 browser_->ExitCct();
466 } 468 }
467 469
470 void UiSceneManager::OnUnsupportedMode(UiUnsupportedMode mode) {
471 browser_->OnUnsupportedMode(mode);
472 }
473
468 int UiSceneManager::AllocateId() { 474 int UiSceneManager::AllocateId() {
469 return next_available_id_++; 475 return next_available_id_++;
470 } 476 }
471 477
472 } // namespace vr_shell 478 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698