suggested_content_info_view.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 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. #include "ash/app_list/views/suggested_content_info_view.h"
  5. #include "ash/app_list/app_list_view_delegate.h"
  6. #include "ash/app_list/views/privacy_container_view.h"
  7. #include "ash/public/cpp/new_window_delegate.h"
  8. #include "ash/strings/grit/ash_strings.h"
  9. #include "url/gurl.h"
  10. namespace ash {
  11. SuggestedContentInfoView::SuggestedContentInfoView(
  12. AppListViewDelegate* view_delegate,
  13. PrivacyContainerView* container)
  14. : PrivacyInfoView(IDS_APP_LIST_SUGGESTED_CONTENT_INFO,
  15. IDS_APP_LIST_MANAGE_SETTINGS),
  16. view_delegate_(view_delegate),
  17. container_(container) {}
  18. SuggestedContentInfoView::~SuggestedContentInfoView() = default;
  19. void SuggestedContentInfoView::CloseButtonPressed() {
  20. view_delegate_->MarkSuggestedContentInfoDismissed();
  21. container_->Update();
  22. }
  23. void SuggestedContentInfoView::LinkClicked() {
  24. view_delegate_->MarkSuggestedContentInfoDismissed();
  25. constexpr char url[] = "chrome://os-settings/osPrivacy";
  26. NewWindowDelegate::GetInstance()->OpenUrl(
  27. GURL(url), NewWindowDelegate::OpenUrlFrom::kUserInteraction,
  28. NewWindowDelegate::Disposition::kNewForegroundTab);
  29. }
  30. } // namespace ash