Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1543)

Unified Diff: apps/app_lifetime_monitor.cc

Issue 2729503007: Remove Profile usage from //apps (Closed)
Patch Set: deps Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_lifetime_monitor.h ('k') | apps/app_lifetime_monitor_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_lifetime_monitor.cc
diff --git a/apps/app_lifetime_monitor.cc b/apps/app_lifetime_monitor.cc
index 1edaa3b469fba791f4a45675b3d94d219cce8dfa..0e2169e2fc6281ca46fe3a9df2994ee61f06d1d0 100644
--- a/apps/app_lifetime_monitor.cc
+++ b/apps/app_lifetime_monitor.cc
@@ -4,7 +4,7 @@
#include "apps/app_lifetime_monitor.h"
-#include "chrome/browser/profiles/profile.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "extensions/browser/app_window/app_window.h"
@@ -19,8 +19,8 @@ using extensions::AppWindowRegistry;
using extensions::Extension;
using extensions::ExtensionHost;
-AppLifetimeMonitor::AppLifetimeMonitor(Profile* profile)
- : profile_(profile) {
+AppLifetimeMonitor::AppLifetimeMonitor(content::BrowserContext* context)
+ : context_(context) {
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD,
content::NotificationService::AllSources());
@@ -29,7 +29,7 @@ AppLifetimeMonitor::AppLifetimeMonitor(Profile* profile)
content::NotificationService::AllSources());
AppWindowRegistry* app_window_registry =
- AppWindowRegistry::Factory::GetForBrowserContext(profile_,
+ AppWindowRegistry::Factory::GetForBrowserContext(context_,
false /* create */);
DCHECK(app_window_registry);
app_window_registry->AddObserver(this);
@@ -94,7 +94,7 @@ void AppLifetimeMonitor::OnAppWindowShown(AppWindow* app_window,
void AppLifetimeMonitor::Shutdown() {
AppWindowRegistry* app_window_registry =
- AppWindowRegistry::Factory::GetForBrowserContext(profile_,
+ AppWindowRegistry::Factory::GetForBrowserContext(context_,
false /* create */);
if (app_window_registry)
app_window_registry->RemoveObserver(this);
@@ -117,22 +117,22 @@ bool AppLifetimeMonitor::HasOtherVisibleAppWindows(
void AppLifetimeMonitor::NotifyAppStart(const std::string& app_id) {
for (auto& observer : observers_)
- observer.OnAppStart(profile_, app_id);
+ observer.OnAppStart(context_, app_id);
}
void AppLifetimeMonitor::NotifyAppActivated(const std::string& app_id) {
for (auto& observer : observers_)
- observer.OnAppActivated(profile_, app_id);
+ observer.OnAppActivated(context_, app_id);
}
void AppLifetimeMonitor::NotifyAppDeactivated(const std::string& app_id) {
for (auto& observer : observers_)
- observer.OnAppDeactivated(profile_, app_id);
+ observer.OnAppDeactivated(context_, app_id);
}
void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) {
for (auto& observer : observers_)
- observer.OnAppStop(profile_, app_id);
+ observer.OnAppStop(context_, app_id);
}
} // namespace apps
« no previous file with comments | « apps/app_lifetime_monitor.h ('k') | apps/app_lifetime_monitor_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698