Commit 65adf9e0 authored by Sigurdur Asgeirsson's avatar Sigurdur Asgeirsson Committed by Commit Bot

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

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=estade@chromium.org

Bug: 1145565
Change-Id: Icbd9700d976f131d4507a9601d7664894806da2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547961
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Auto-Submit: Sigurður Ásgeirsson <siggi@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829253}
parent b80230b6
...@@ -36,13 +36,14 @@ AutofillBubbleHandlerImpl::AutofillBubbleHandlerImpl( ...@@ -36,13 +36,14 @@ AutofillBubbleHandlerImpl::AutofillBubbleHandlerImpl(
ToolbarButtonProvider* toolbar_button_provider) ToolbarButtonProvider* toolbar_button_provider)
: browser_(browser), toolbar_button_provider_(toolbar_button_provider) { : browser_(browser), toolbar_button_provider_(toolbar_button_provider) {
if (browser->profile()) { if (browser->profile()) {
personal_data_manager_observer_.Add( personal_data_manager_observation_.Observe(
PersonalDataManagerFactory::GetForProfile( PersonalDataManagerFactory::GetForProfile(
browser->profile()->GetOriginalProfile())); browser->profile()->GetOriginalProfile()));
} }
if (toolbar_button_provider_->GetAvatarToolbarButton()) if (toolbar_button_provider_->GetAvatarToolbarButton()) {
avatar_toolbar_button_observer_.Add( avatar_toolbar_button_observation_.Observe(
toolbar_button_provider_->GetAvatarToolbarButton()); toolbar_button_provider_->GetAvatarToolbarButton());
}
} }
AutofillBubbleHandlerImpl::~AutofillBubbleHandlerImpl() = default; AutofillBubbleHandlerImpl::~AutofillBubbleHandlerImpl() = default;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_BUBBLE_HANDLER_IMPL_H_ #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_BUBBLE_HANDLER_IMPL_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/scoped_observer.h" #include "base/scoped_observation.h"
#include "chrome/browser/ui/autofill/autofill_bubble_handler.h" #include "chrome/browser/ui/autofill/autofill_bubble_handler.h"
#include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h" #include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h"
#include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/personal_data_manager.h"
...@@ -70,10 +70,10 @@ class AutofillBubbleHandlerImpl : public AutofillBubbleHandler, ...@@ -70,10 +70,10 @@ class AutofillBubbleHandlerImpl : public AutofillBubbleHandler,
// button after the highlight animation finishes. // button after the highlight animation finishes.
bool should_show_sign_in_promo_if_applicable_ = false; bool should_show_sign_in_promo_if_applicable_ = false;
ScopedObserver<PersonalDataManager, PersonalDataManagerObserver> base::ScopedObservation<PersonalDataManager, PersonalDataManagerObserver>
personal_data_manager_observer_{this}; personal_data_manager_observation_{this};
ScopedObserver<AvatarToolbarButton, AvatarToolbarButton::Observer> base::ScopedObservation<AvatarToolbarButton, AvatarToolbarButton::Observer>
avatar_toolbar_button_observer_{this}; avatar_toolbar_button_observation_{this};
DISALLOW_COPY_AND_ASSIGN(AutofillBubbleHandlerImpl); DISALLOW_COPY_AND_ASSIGN(AutofillBubbleHandlerImpl);
}; };
......
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