| 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/toolbar_helper.h" | 5 #include "chrome/browser/android/vr_shell/toolbar_helper.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/toolbar/toolbar_model_impl.h" | 8 #include "components/toolbar/toolbar_model_impl.h" |
| 9 | 9 |
| 10 class ToolbarModelDelegate; | 10 class ToolbarModelDelegate; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 : ui_(ui), | 23 : ui_(ui), |
| 24 toolbar_model_( | 24 toolbar_model_( |
| 25 base::MakeUnique<ToolbarModelImpl>(delegate, kMaxURLDisplayChars)) {} | 25 base::MakeUnique<ToolbarModelImpl>(delegate, kMaxURLDisplayChars)) {} |
| 26 | 26 |
| 27 ToolbarHelper::~ToolbarHelper() {} | 27 ToolbarHelper::~ToolbarHelper() {} |
| 28 | 28 |
| 29 void ToolbarHelper::Update() { | 29 void ToolbarHelper::Update() { |
| 30 ToolbarState state( | 30 ToolbarState state( |
| 31 toolbar_model_->GetURL(), toolbar_model_->GetSecurityLevel(true), | 31 toolbar_model_->GetURL(), toolbar_model_->GetSecurityLevel(true), |
| 32 &toolbar_model_->GetVectorIcon(), toolbar_model_->GetSecureVerboseText(), | 32 &toolbar_model_->GetVectorIcon(), toolbar_model_->GetSecureVerboseText(), |
| 33 toolbar_model_->ShouldDisplayURL()); | 33 toolbar_model_->ShouldDisplayURL(), toolbar_model_->IsOfflinePage()); |
| 34 | 34 |
| 35 if (current_state_ == state) | 35 if (current_state_ == state) |
| 36 return; | 36 return; |
| 37 current_state_ = state; | 37 current_state_ = state; |
| 38 ui_->SetToolbarState(state); | 38 ui_->SetToolbarState(state); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace vr_shell | 41 } // namespace vr_shell |
| OLD | NEW |