unified_vpn_detailed_view_controller.cc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. //
  5. #include "ash/system/network/unified_vpn_detailed_view_controller.h"
  6. #include "ash/session/session_controller_impl.h"
  7. #include "ash/shell.h"
  8. #include "ash/strings/grit/ash_strings.h"
  9. #include "ash/system/network/vpn_list_view.h"
  10. #include "ash/system/tray/detailed_view_delegate.h"
  11. #include "ui/base/l10n/l10n_util.h"
  12. namespace ash {
  13. UnifiedVPNDetailedViewController::UnifiedVPNDetailedViewController(
  14. UnifiedSystemTrayController* tray_controller)
  15. : detailed_view_delegate_(
  16. std::make_unique<DetailedViewDelegate>(tray_controller)) {
  17. }
  18. UnifiedVPNDetailedViewController::~UnifiedVPNDetailedViewController() = default;
  19. views::View* UnifiedVPNDetailedViewController::CreateView() {
  20. DCHECK(!view_);
  21. view_ = new VPNListView(detailed_view_delegate_.get(),
  22. Shell::Get()->session_controller()->login_status());
  23. view_->Init();
  24. return view_;
  25. }
  26. std::u16string UnifiedVPNDetailedViewController::GetAccessibleName() const {
  27. return l10n_util::GetStringUTF16(
  28. IDS_ASH_QUICK_SETTINGS_BUBBLE_VPN_SETTINGS_ACCESSIBLE_DESCRIPTION);
  29. }
  30. } // namespace ash