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

Unified Diff: chrome/browser/android/vr_shell/ui_elements/url_bar.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
Index: chrome/browser/android/vr_shell/ui_elements/url_bar.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements/url_bar.cc b/chrome/browser/android/vr_shell/ui_elements/url_bar.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7e8d9c49a9b0c6d3c0fa5a5da06e9c33362c7179
--- /dev/null
+++ b/chrome/browser/android/vr_shell/ui_elements/url_bar.cc
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/vr_shell/ui_elements/url_bar.h"
+
+#include "base/memory/ptr_util.h"
+#include "chrome/browser/android/vr_shell/textures/url_bar_texture.h"
+
+namespace vr_shell {
+
+UrlBar::UrlBar(int preferred_width)
+ : TexturedElement(preferred_width),
+ texture_(base::MakeUnique<UrlBarTexture>()) {}
+
+UrlBar::~UrlBar() = default;
+
+void UrlBar::OnHoverEnter() {
+ texture_->SetHover(true);
+ Update();
+}
+
+void UrlBar::OnHoverLeave() {
+ texture_->SetHover(false);
+ Update();
+}
+
+UiTexture* UrlBar::GetTexture() const {
+ return texture_.get();
+}
+
+void UrlBar::SetURL(const GURL& gurl) {
+ texture_->SetURL(gurl);
+}
+
+} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements/url_bar.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698