| 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/url_bar.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/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 { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 void UrlBar::SetSecurityLevel(int level) { | 85 void UrlBar::SetSecurityLevel(int level) { |
| 86 texture_->SetSecurityLevel(level); | 86 texture_->SetSecurityLevel(level); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { | 89 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { |
| 90 back_button_callback_ = callback; | 90 back_button_callback_ = callback; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void UrlBar::SetIncognito(bool incognito) { |
| 94 texture_->SetIncognito(incognito); |
| 95 } |
| 96 |
| 93 void UrlBar::OnStateUpdated(const gfx::PointF& position) { | 97 void UrlBar::OnStateUpdated(const gfx::PointF& position) { |
| 94 const bool hovered = texture_->HitsBackButton(position); | 98 const bool hovered = texture_->HitsBackButton(position); |
| 95 const bool pressed = hovered ? down_ : false; | 99 const bool pressed = hovered ? down_ : false; |
| 96 | 100 |
| 97 texture_->SetHovered(hovered); | 101 texture_->SetHovered(hovered); |
| 98 texture_->SetPressed(pressed); | 102 texture_->SetPressed(pressed); |
| 99 UpdateTexture(); | 103 UpdateTexture(); |
| 100 } | 104 } |
| 101 | 105 |
| 102 } // namespace vr_shell | 106 } // namespace vr_shell |
| OLD | NEW |