| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 last_begin_frame_time_ = begin_frame_time; | 54 last_begin_frame_time_ = begin_frame_time; |
| 55 if (enabled_ && texture_->dirty()) { | 55 if (enabled_ && texture_->dirty()) { |
| 56 int64_t delta_ms = (begin_frame_time - last_update_time_).InMilliseconds(); | 56 int64_t delta_ms = (begin_frame_time - last_update_time_).InMilliseconds(); |
| 57 if (delta_ms > kUpdateDelayMS) | 57 if (delta_ms > kUpdateDelayMS) |
| 58 UpdateTexture(); | 58 UpdateTexture(); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 void UrlBar::SetEnabled(bool enabled) { | 62 void UrlBar::SetEnabled(bool enabled) { |
| 63 enabled_ = enabled; | 63 enabled_ = enabled; |
| 64 set_visible(enabled); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void UrlBar::SetURL(const GURL& gurl) { | 67 void UrlBar::SetURL(const GURL& gurl) { |
| 67 texture_->SetURL(gurl); | 68 texture_->SetURL(gurl); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void UrlBar::SetSecurityLevel(int level) { | 71 void UrlBar::SetSecurityLevel(int level) { |
| 71 texture_->SetSecurityLevel(level); | 72 texture_->SetSecurityLevel(level); |
| 72 } | 73 } |
| 73 | 74 |
| 74 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { | 75 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { |
| 75 back_button_callback_ = callback; | 76 back_button_callback_ = callback; |
| 76 } | 77 } |
| 77 | 78 |
| 78 } // namespace vr_shell | 79 } // namespace vr_shell |
| OLD | NEW |