Commit 0833e896 authored by Glen Robertson's avatar Glen Robertson Committed by Commit Bot

Delete NOTIFICATION_PROFILE_DESTROYED.

This was only used in one test and is covered by an observer interface
method.
This cleans up a dependency from profile.cc on //c/b target towards
moving profile into its own target.

Bug: 268984,1149277
Change-Id: Ic12380f8175214da5ce6920172252178e3268126
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550158
Commit-Queue: Glen Robertson <glenrob@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Auto-Submit: Glen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830073}
parent b51db0e8
......@@ -124,13 +124,6 @@ enum NotificationType {
// The details are none and the source is the new profile.
NOTIFICATION_PROFILE_ADDED,
// Use KeyedServiceShutdownNotifier instead this notification type (you did
// read the comment at the top of the file, didn't you?).
// Sent before a Profile is destroyed. This notification is sent both for
// normal and OTR profiles.
// The details are none and the source is a Profile*.
NOTIFICATION_PROFILE_DESTROYED,
// Printing ----------------------------------------------------------------
// Notification from PrintJob that an event occurred. It can be that a page
......
......@@ -11,7 +11,6 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/profiles/profile_manager.h"
......@@ -484,11 +483,6 @@ void Profile::MaybeSendDestroyedNotification() {
for (auto& observer : observers_)
observer.OnProfileWillBeDestroyed(this);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_PROFILE_DESTROYED,
content::Source<Profile>(this),
content::NotificationService::NoDetails());
}
}
......
......@@ -504,9 +504,9 @@ class Profile : public content::BrowserContext {
// This method is virtual in order to be overridden for tests.
virtual bool IsNewProfile() const;
// Send NOTIFICATION_PROFILE_DESTROYED for this Profile, if it has not
// already been sent. It is necessary because most Profiles are destroyed by
// ProfileDestroyer, but in tests, some are not.
// Notify observers of |OnProfileWillBeDestroyed| for this profile, if it has
// not already been called. It is necessary because most Profiles are
// destroyed by ProfileDestroyer, but in tests, some are not.
void MaybeSendDestroyedNotification();
#if !defined(OS_ANDROID)
......
......@@ -755,13 +755,11 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) {
// Destroy the off-the-record profile.
{
content::WindowedNotificationObserver profile_destroyed_observer(
chrome::NOTIFICATION_PROFILE_DESTROYED,
content::Source<Profile>(otr_profile));
ProfileDestructionWatcher watcher;
watcher.Watch(otr_profile);
if (profile->HasPrimaryOTRProfile()) {
profile->DestroyOffTheRecordProfile(profile->GetPrimaryOTRProfile());
profile_destroyed_observer.Wait();
watcher.WaitForDestruction();
}
EXPECT_FALSE(profile->HasPrimaryOTRProfile());
......@@ -769,12 +767,10 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) {
// Destroy the regular profile.
{
content::WindowedNotificationObserver profile_destroyed_observer(
chrome::NOTIFICATION_PROFILE_DESTROYED,
content::Source<Profile>(profile.get()));
ProfileDestructionWatcher watcher;
watcher.Watch(profile.get());
profile.reset();
profile_destroyed_observer.Wait();
watcher.WaitForDestruction();
}
// Pending tasks related to |profile| could depend on |temp_dir|. We need to
......
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