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

Unified Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2862283002: VR: Add initial URL bar element and texture. (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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/ui_scene_manager.cc
diff --git a/chrome/browser/android/vr_shell/ui_scene_manager.cc b/chrome/browser/android/vr_shell/ui_scene_manager.cc
index 5d4f55aefcfd060fa6f1a8170ba75d20015504fc..7d78f93102acb744a5dbc94ea1f3004162112859 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc
@@ -7,9 +7,9 @@
#include "base/memory/ptr_util.h"
#include "chrome/browser/android/vr_shell/textures/ui_texture.h"
#include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning.h"
-#include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
#include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning.h"
#include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
+#include "chrome/browser/android/vr_shell/ui_elements/url_bar.h"
#include "chrome/browser/android/vr_shell/ui_scene.h"
#include "chrome/browser/android/vr_shell/vr_browser_interface.h"
#include "chrome/browser/android/vr_shell/vr_shell.h"
@@ -49,6 +49,7 @@ UiSceneManager::UiSceneManager(VrBrowserInterface* browser, UiScene* scene)
CreateBackground();
CreateContentQuad();
CreateSecurityWarnings();
+ CreateUrlBar();
}
UiSceneManager::~UiSceneManager() {}
@@ -164,6 +165,18 @@ void UiSceneManager::CreateBackground() {
scene_->SetBackgroundColor(kBackgroundHorizonColor);
}
+void UiSceneManager::CreateUrlBar() {
+ // TODO(cjgrant): Incorporate final size and position.
+ // TODO(cjgrant): Add the loading progress indicator element.
+ auto element = base::MakeUnique<UrlBar>(512);
+ element->set_id(AllocateId());
+ element->set_translation({0, -0.9, -1.8});
+ element->set_size({0.9, 0, 1});
+ url_bar_ = element.get();
+ browser_ui_elements_.push_back(element.get());
+ scene_->AddUiElement(std::move(element));
+}
+
base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
@@ -209,6 +222,10 @@ void UiSceneManager::OnSecurityWarningTimer() {
transient_security_warning_->set_visible(false);
}
+void UiSceneManager::OnUrlChange(const GURL& gurl) {
+ url_bar_->SetGURL(gurl);
+}
+
int UiSceneManager::AllocateId() {
return next_available_id_++;
}

Powered by Google App Engine
This is Rietveld 408576698