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

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

Issue 2862283002: VR: Add initial URL bar element and texture. (Closed)
Patch Set: Drop anti-aliasing. 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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d424947c0b36e4bd136d79640a2b6b4a0f1cdca..0fd987d8683efab56fd27ea2cfd90c347235141e 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"
@@ -58,6 +58,7 @@ UiSceneManager::UiSceneManager(VrBrowserInterface* browser,
CreateBackground();
CreateContentQuad();
CreateSecurityWarnings();
+ CreateUrlBar();
}
UiSceneManager::~UiSceneManager() {}
@@ -178,6 +179,18 @@ void UiSceneManager::CreateBackground() {
scene_->SetBackgroundColor(horizon);
}
+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();
}
@@ -223,6 +236,10 @@ void UiSceneManager::OnSecurityWarningTimer() {
transient_security_warning_->set_visible(false);
}
+void UiSceneManager::OnUrlChange(const GURL& gurl) {
+ url_bar_->SetURL(gurl);
+}
+
int UiSceneManager::AllocateId() {
return next_available_id_++;
}
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698