30 #include <sbIPropertyArray.h>
31 #include <sbIPropertyManager.h>
32 #include <nsITreeView.h>
35 #include <nsNetUtil.h>
36 #include <nsServiceManagerUtils.h>
37 #include <nsUnicharUtils.h>
41 const nsAString& aDisplayName,
42 const nsAString& aLocalizationKey,
43 const PRBool aRemoteReadable,
44 const PRBool aRemoteWritable,
45 const PRBool aUserViewable,
46 const PRBool aUserEditable) :
64 NS_ENSURE_SUCCESS(rv, rv);
66 nsCOMPtr<nsIFaviconService> faviconService =
67 do_GetService(
"@mozilla.org/browser/favicon-service;1", &rv);
68 NS_ENSURE_SUCCESS(rv, rv);
73 NS_ENSURE_SUCCESS(rv, rv);
84 if(aValue.IsEmpty() ||
86 aValue.EqualsLiteral(
"unknownOrigin") ||
87 aValue.EqualsLiteral(
"webOrigin")) {
93 nsresult rv = NS_NewURI(getter_AddRefs(uri), aValue);
94 NS_ENSURE_SUCCESS(rv, rv);
96 nsCOMPtr<nsIURI> imageUri;
99 if(rv == NS_ERROR_NOT_AVAILABLE) {
104 NS_ENSURE_SUCCESS(rv, rv);
107 rv = imageUri->GetSpec(spec);
108 NS_ENSURE_SUCCESS(rv, rv);
110 NS_NAMED_LITERAL_CSTRING(mozAnnoFavicon,
"moz-anno:favicon:");
111 if(!StringBeginsWith(spec, mozAnnoFavicon)) {
112 _retval = NS_ConvertUTF8toUTF16(spec);
116 spec.Cut(0, mozAnnoFavicon.Length());
117 NS_WARNING(spec.get());
118 _retval = NS_ConvertUTF8toUTF16(spec);
127 if(aValue.EqualsLiteral(
"unknownOrigin") ||
130 _retval.AssignLiteral(
"image unknownOrigin");
134 if(aValue.EqualsLiteral(
"webOrigin") ||
135 StringBeginsWith(aValue, NS_LITERAL_STRING(
"http://"), CaseInsensitiveCompare) ||
136 StringBeginsWith(aValue, NS_LITERAL_STRING(
"https://"), CaseInsensitiveCompare) ||
137 StringBeginsWith(aValue, NS_LITERAL_STRING(
"ftp://"), CaseInsensitiveCompare)) {
139 _retval.AssignLiteral(
"image webOrigin");
143 _retval.AssignLiteral(
"image");
150 const nsAString& aUrlValue,
153 NS_ENSURE_ARG_POINTER(_retval);
155 *_retval = aImageValue.LowerCaseEqualsLiteral(
"unknownOrigin") ||
156 aImageValue.IsEmpty() ||
NS_IMETHOD GetImageSrc(const nsAString &aValue, nsAString &_retval)
#define SB_PROPERTY_ORIGINPAGE
nsCOMPtr< nsIFaviconService > mFaviconService
NS_IMETHOD GetPreventNavigation(const nsAString &aImageValue, const nsAString &aUrlValue, PRBool *_retval)
NS_IMETHOD GetCellProperties(const nsAString &aValue, nsAString &_retval)
sbOriginPageImagePropertyInfo(const nsAString &aPropertyID, const nsAString &aDisplayName, const nsAString &aLocalizationKey, const PRBool aRemoteReadable, const PRBool aRemoteWritable, const PRBool aUserViewable, const PRBool aUserEditable)