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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/event_router.cc

Issue 2487623002: Notify Files App when ARC++ app is installed/removed (Closed)
Patch Set: Add RemoverObserver. Created 4 years, 1 month 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
Index: chrome/browser/chromeos/extensions/file_manager/event_router.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
index 2b78461c5a07ff58cbacdfa590ab0b40537a8eae..9d4dc9c2867afd341bfb0d29195908662a6669d1 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -400,8 +400,21 @@ EventRouter::EventRouter(Profile* profile)
EventRouter::~EventRouter() {
}
+void EventRouter::OnAppsUpdated() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BroadcastEvent(profile_,
+ extensions::events::FILE_MANAGER_PRIVATE_ON_APPS_UPDATED,
+ file_manager_private::OnAppsUpdated::kEventName,
+ file_manager_private::OnAppsUpdated::Create());
+}
+
void EventRouter::Shutdown() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ arc::ArcIntentHelperBridge* bridge = arc::ArcIntentHelperBridge::Get();
+ DCHECK(bridge);
+ bridge->RemoveObserver(this);
Yusuke Sato 2016/11/21 17:21:05 How did you test this? |bridge| might be NULL.
oka 2016/11/24 15:14:17 Test procedure is written in https://codereview.ch
+
chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this);
DLOG_IF(WARNING, !file_watchers_.empty())
@@ -492,6 +505,10 @@ void EventRouter::ObserveEvents() {
pref_change_registrar_->Add(prefs::kUse24HourClock, callback);
chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this);
+
+ arc::ArcIntentHelperBridge* bridge = arc::ArcIntentHelperBridge::Get();
+ DCHECK(bridge);
+ bridge->AddObserver(this);
}
// File watch setup routines.

Powered by Google App Engine
This is Rietveld 408576698