| 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/exit_prompt.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/exit_prompt.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/exit_prompt_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/exit_prompt_texture.h" |
| 9 | 9 |
| 10 namespace vr_shell { | 10 namespace vr_shell { |
| 11 | 11 |
| 12 ExitPrompt::ExitPrompt(int preferred_width, | 12 ExitPrompt::ExitPrompt(int id, |
| 13 int preferred_width, |
| 13 const base::Callback<void()>& primary_button_callback, | 14 const base::Callback<void()>& primary_button_callback, |
| 14 const base::Callback<void()>& secondary_buttton_callback) | 15 const base::Callback<void()>& secondary_buttton_callback) |
| 15 : TexturedElement(preferred_width), | 16 : TexturedElement(id, preferred_width), |
| 16 texture_(base::MakeUnique<ExitPromptTexture>()), | 17 texture_(base::MakeUnique<ExitPromptTexture>()), |
| 17 primary_button_callback_(primary_button_callback), | 18 primary_button_callback_(primary_button_callback), |
| 18 secondary_buttton_callback_(secondary_buttton_callback) {} | 19 secondary_buttton_callback_(secondary_buttton_callback) {} |
| 19 | 20 |
| 20 ExitPrompt::~ExitPrompt() = default; | 21 ExitPrompt::~ExitPrompt() = default; |
| 21 | 22 |
| 22 void ExitPrompt::SetTextureForTesting(ExitPromptTexture* texture) { | 23 void ExitPrompt::SetTextureForTesting(ExitPromptTexture* texture) { |
| 23 texture_.reset(texture); | 24 texture_.reset(texture); |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 texture_->SetSecondaryButtonPressed(secondary_hovered ? secondary_down_ | 67 texture_->SetSecondaryButtonPressed(secondary_hovered ? secondary_down_ |
| 67 : false); | 68 : false); |
| 68 UpdateTexture(); | 69 UpdateTexture(); |
| 69 } | 70 } |
| 70 | 71 |
| 71 UiTexture* ExitPrompt::GetTexture() const { | 72 UiTexture* ExitPrompt::GetTexture() const { |
| 72 return texture_.get(); | 73 return texture_.get(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace vr_shell | 76 } // namespace vr_shell |
| OLD | NEW |