mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 904025 - part1: pass phone state to child process. r=khuey
This commit is contained in:
parent
c797838e6d
commit
e79d5d6cda
@ -1369,6 +1369,16 @@ ContentChild::RecvCancelMinimizeMemoryUsage()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvNotifyPhoneStateChange(const nsString& aState)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
||||
if (os) {
|
||||
os->NotifyObservers(nullptr, "phone-state-changed", aState.get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvLoadAndRegisterSheet(const URIParams& aURI, const uint32_t& aType)
|
||||
{
|
||||
|
@ -225,6 +225,7 @@ public:
|
||||
virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI, const uint32_t& aType);
|
||||
virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType);
|
||||
|
||||
virtual bool RecvNotifyPhoneStateChange(const nsString& state);
|
||||
#ifdef ANDROID
|
||||
gfxIntSize GetScreenSize() { return mScreenSize; }
|
||||
#endif
|
||||
|
@ -668,6 +668,7 @@ ContentParent::Init()
|
||||
obs->AddObserver(this, "file-watcher-update", false);
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
obs->AddObserver(this, NS_VOLUME_STATE_CHANGED, false);
|
||||
obs->AddObserver(this, "phone-state-changed", false);
|
||||
#endif
|
||||
#ifdef ACCESSIBILITY
|
||||
obs->AddObserver(this, "a11y-init-or-shutdown", false);
|
||||
@ -1762,6 +1763,9 @@ ContentParent::Observe(nsISupports* aSubject,
|
||||
unused << SendFileSystemUpdate(volName, mountPoint, state,
|
||||
mountGeneration, isMediaPresent,
|
||||
isSharing);
|
||||
} else if (!strcmp(aTopic, "phone-state-changed")) {
|
||||
nsString state(aData);
|
||||
unused << SendNotifyPhoneStateChange(state);
|
||||
}
|
||||
#endif
|
||||
#ifdef ACCESSIBILITY
|
||||
|
@ -319,6 +319,7 @@ child:
|
||||
async LoadAndRegisterSheet(URIParams uri, uint32_t type);
|
||||
async UnregisterSheet(URIParams uri, uint32_t type);
|
||||
|
||||
NotifyPhoneStateChange(nsString newState);
|
||||
parent:
|
||||
/**
|
||||
* Tell the content process some attributes of itself. This is
|
||||
|
Loading…
x
Reference in New Issue
Block a user