Commit 109bc266 authored by Sigurdur Asgeirsson's avatar Sigurdur Asgeirsson Committed by Commit Bot

Retire ScopedObserver in /chrome/browser/ui/views/download.

ScopedObserver is being deprecated in favor of two new classes:
- base::ScopedObservation for observers that only ever observe
  a single source.
- base::ScopedMultiSourceObservation for observers that do or may
  observe more than a single source.

This CL was uploaded by git cl split.

R=shaktisahu@chromium.org

Bug: 1145565
Change-Id: I6d607bcafec4a912694f42c48881bcbec04914de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547770
Auto-Submit: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828967}
parent f84e6625
...@@ -250,7 +250,7 @@ DownloadItemView::DownloadItemView(DownloadUIModel::DownloadUIModelPtr model, ...@@ -250,7 +250,7 @@ DownloadItemView::DownloadItemView(DownloadUIModel::DownloadUIModelPtr model,
base::BindRepeating(&DownloadItemView::AnnounceAccessibleAlert, base::BindRepeating(&DownloadItemView::AnnounceAccessibleAlert,
base::Unretained(this))) { base::Unretained(this))) {
views::InstallRectHighlightPathGenerator(this); views::InstallRectHighlightPathGenerator(this);
observer_.Add(this->model()); observation_.Observe(this->model());
// TODO(pkasting): Use bespoke file-scope subclasses for some of these child // TODO(pkasting): Use bespoke file-scope subclasses for some of these child
// views to localize functionality and simplify this class. // views to localize functionality and simplify this class.
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/scoped_observer.h" #include "base/scoped_observation.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h" #include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -297,7 +297,8 @@ class DownloadItemView : public views::View, ...@@ -297,7 +297,8 @@ class DownloadItemView : public views::View,
// Forces reading the current alert text the next time it updates. // Forces reading the current alert text the next time it updates.
bool announce_accessible_alert_soon_ = false; bool announce_accessible_alert_soon_ = false;
ScopedObserver<DownloadUIModel, DownloadUIModel::Observer> observer_{this}; base::ScopedObservation<DownloadUIModel, DownloadUIModel::Observer>
observation_{this};
// Method factory used to delay reenabling of the item when opening the // Method factory used to delay reenabling of the item when opening the
// downloaded file. // downloaded file.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment