| OLD | NEW |
| 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_elements/transient_url_bar.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/transient_url_bar.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" |
| 9 | 9 |
| 10 namespace vr_shell { | 10 namespace vr_shell { |
| 11 | 11 |
| 12 TransientUrlBar::TransientUrlBar( | 12 TransientUrlBar::TransientUrlBar( |
| 13 int preferred_width, | 13 int preferred_width, |
| 14 const base::Callback<void(UiUnsupportedMode)>& failure_callback) | 14 const base::Callback<void(UiUnsupportedMode)>& failure_callback) |
| 15 : TexturedElement(preferred_width), | 15 : TexturedElement(preferred_width), |
| 16 texture_(base::MakeUnique<UrlBarTexture>(true, failure_callback)) {} | 16 texture_(base::MakeUnique<UrlBarTexture>(true, failure_callback)) {} |
| 17 | 17 |
| 18 TransientUrlBar::~TransientUrlBar() = default; | 18 TransientUrlBar::~TransientUrlBar() = default; |
| 19 | 19 |
| 20 UiTexture* TransientUrlBar::GetTexture() const { | 20 UiTexture* TransientUrlBar::GetTexture() const { |
| 21 return texture_.get(); | 21 return texture_.get(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void TransientUrlBar::SetURL(const GURL& gurl) { | 24 void TransientUrlBar::SetToolbarState(const ToolbarState& state) { |
| 25 texture_->SetURL(gurl); | 25 texture_->SetToolbarState(state); |
| 26 UpdateTexture(); | |
| 27 } | |
| 28 | |
| 29 void TransientUrlBar::SetSecurityInfo(security_state::SecurityLevel level, | |
| 30 bool malware) { | |
| 31 texture_->SetSecurityInfo(level, malware); | |
| 32 UpdateTexture(); | |
| 33 } | 26 } |
| 34 | 27 |
| 35 } // namespace vr_shell | 28 } // namespace vr_shell |
| OLD | NEW |