Backed out changeset bd2a54f589c3 (bug 915002) for mochitest-8 bustage

This commit is contained in:
Phil Ringnalda 2013-10-03 07:41:07 -07:00
parent b028a68881
commit 5bf4db3874
8 changed files with 25 additions and 62 deletions

View File

@ -886,20 +886,18 @@ var AlertsHelper = {
}
let data = aMessage.data;
let details = data.details;
let listener = {
mm: aMessage.target,
title: data.title,
text: data.text,
manifestURL: details.manifestURL,
manifestURL: data.manifestURL,
imageURL: data.imageURL
};
}
this.registerAppListener(data.uid, listener);
this.showNotification(data.imageURL, data.title, data.text,
details.textClickable, null,
data.uid, details.dir,
details.lang, details.manifestURL);
data.textClickable, null,
data.uid, null, null, data.manifestURL);
},
}

View File

@ -65,16 +65,17 @@ AlertsService.prototype = {
showAppNotification: function showAppNotification(aImageURL,
aTitle,
aText,
aTextClickable,
aManifestURL,
aAlertListener,
aDetails) {
let uid = (aDetails.id == "") ?
"app-notif-" + uuidGenerator.generateUUID() : aDetails.id;
aId) {
let uid = (aId == "") ? "app-notif-" + uuidGenerator.generateUUID() : aId;
this._listeners[uid] = {
observer: aAlertListener,
title: aTitle,
text: aText,
manifestURL: aDetails.manifestURL,
manifestURL: aManifestURL,
imageURL: aImageURL
};
@ -82,8 +83,9 @@ AlertsService.prototype = {
imageURL: aImageURL,
title: aTitle,
text: aText,
uid: uid,
details: aDetails
textClickable: aTextClickable,
manifestURL: aManifestURL,
uid: uid
});
},

View File

@ -7,14 +7,14 @@
interface nsIObserver;
// Notification service that also provides the manifest URL
[scriptable, uuid(50cb17d2-dc8a-4aa6-bcd3-94d76af14e20)]
[scriptable, uuid(61c4adf4-187d-4d18-937c-4df17bc01073)]
interface nsIAppNotificationService : nsISupports
{
void showAppNotification(in AString imageUrl,
in AString title,
in AString text,
in nsIObserver alertListener,
// details should be a WebIDL
// AppNotificationServiceOptions Dictionary object
in jsval details);
[optional] in boolean textClickable,
[optional] in AString manifestURL,
[optional] in nsIObserver alertListener,
[optional] in AString id);
};

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/DesktopNotification.h"
#include "mozilla/dom/DesktopNotificationBinding.h"
#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
#include "nsContentPermissionHelper.h"
#include "nsXULAppAPI.h"
#include "mozilla/dom/PBrowserChild.h"
@ -92,18 +91,11 @@ DesktopNotification::PostDesktopNotification()
nsCOMPtr<nsIAppsService> appsService = do_GetService("@mozilla.org/AppsService;1");
nsString manifestUrl = EmptyString();
appsService->GetManifestURLByLocalId(appId, manifestUrl);
mozilla::AutoSafeJSContext cx;
JS::RootedValue val(cx);
AppNotificationServiceOptionsInitializer ops;
ops.mTextClickable = true;
ops.mManifestURL = manifestUrl;
if (!ops.ToObject(cx, JS::NullPtr(), &val)) {
return NS_ERROR_FAILURE;
}
return appNotifier->ShowAppNotification(mIconURL, mTitle, mDescription,
mObserver, val);
true,
manifestUrl,
mObserver,
EmptyString());
}
}
#endif

View File

@ -4,7 +4,6 @@
#include "PCOMContentPermissionRequestChild.h"
#include "mozilla/dom/Notification.h"
#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
#include "mozilla/dom/OwningNonNull.h"
#include "mozilla/Preferences.h"
#include "TabChild.h"
@ -376,22 +375,11 @@ Notification::ShowInternal()
nsCOMPtr<nsIAppsService> appsService = do_GetService("@mozilla.org/AppsService;1");
nsString manifestUrl = EmptyString();
appsService->GetManifestURLByLocalId(appId, manifestUrl);
mozilla::AutoSafeJSContext cx;
JS::RootedValue val(cx);
AppNotificationServiceOptionsInitializer ops;
ops.mTextClickable = true;
ops.mManifestURL = manifestUrl;
ops.mId = alertName;
ops.mDir = DirectionToString(mDir);
ops.mLang = mLang;
if (!ops.ToObject(cx, JS::NullPtr(), &val)) {
NS_WARNING("Converting dict to object failed!");
return NS_ERROR_FAILURE;
}
return appNotifier->ShowAppNotification(mIconUrl, mTitle, mBody,
observer, val);
true,
manifestUrl,
observer,
alertName);
}
}
#endif

View File

@ -1,15 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface MozObserver;
dictionary AppNotificationServiceOptions {
boolean textClickable = false;
DOMString manifestURL = "";
DOMString id = "";
DOMString dir = "";
DOMString lang = "";
};

View File

@ -27,7 +27,6 @@ interface DummyInterface : EventTarget {
void DOMWindowResizeEventDetail(optional DOMWindowResizeEventDetail arg);
void WifiOptions(optional WifiCommandOptions arg1,
optional WifiResultOptions arg2);
void AppNotificationServiceOptions(optional AppNotificationServiceOptions arg);
};
interface DummyInterfaceWorkers {

View File

@ -18,7 +18,6 @@ PREPROCESSED_WEBIDL_FILES = [
WEBIDL_FILES = [
'AnalyserNode.webidl',
'AnimationEvent.webidl',
'AppNotificationServiceOptions.webidl',
'ArchiveReader.webidl',
'ArchiveRequest.webidl',
'Attr.webidl',