diff --git a/allmakefiles.sh b/allmakefiles.sh
index 95d61f3e645..b73147ea7cf 100755
--- a/allmakefiles.sh
+++ b/allmakefiles.sh
@@ -1096,6 +1096,7 @@ calendar/sunbird/base/Makefile
MAKEFILES_macbrowser="
camino/Makefile
+camino/flashblock/Makefile
camino/installer/Makefile
"
diff --git a/camino/Camino.xcode/project.pbxproj b/camino/Camino.xcode/project.pbxproj
index 1e739aaec0d..f00318ad2a9 100644
--- a/camino/Camino.xcode/project.pbxproj
+++ b/camino/Camino.xcode/project.pbxproj
@@ -6564,6 +6564,7 @@
dstSubfolderSpec = 6;
files = (
3F44AD5805BDFB9F00CB4B08,
+ 3F44AD5805BDFB9F00CB4B18,
3F44AD5905BDFB9F00CB4B08,
);
isa = PBXCopyFilesBuildPhase;
@@ -6575,6 +6576,12 @@
settings = {
};
};
+ 3F44AD5805BDFB9F00CB4B18 = {
+ fileRef = F6BD650001B3184301A96307;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
3F44AD5905BDFB9F00CB4B08 = {
fileRef = F5DA444A027DD5AA01A80166;
isa = PBXBuildFile;
@@ -10294,6 +10301,7 @@
dstSubfolderSpec = 6;
files = (
3F44AF7305BDFBA000CB4B08,
+ 3F44AF7305BDFBA000CB4B18,
3F44AF7405BDFBA000CB4B08,
);
isa = PBXCopyFilesBuildPhase;
@@ -10305,6 +10313,12 @@
settings = {
};
};
+ 3F44AF7305BDFBA000CB4B18 = {
+ fileRef = F6BD650001B3184301A96307;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
3F44AF7405BDFBA000CB4B08 = {
fileRef = F5DA444A027DD5AA01A80166;
isa = PBXBuildFile;
@@ -18744,6 +18758,7 @@
F6BD64FF01B3184301A962F7 = {
children = (
F6BD650001B3184301A962F7,
+ F6BD650001B3184301A96307,
F54EF7ED022A2F9C01A80165,
F5DA444A027DD5AA01A80166,
);
@@ -18760,6 +18775,14 @@
refType = 2;
sourceTree = SOURCE_ROOT;
};
+ F6BD650001B3184301A96307 = {
+ isa = PBXFileReference;
+ lastKnownFileType = archive.jar;
+ name = flashblock.jar;
+ path = ../dist/Embed/chrome/flashblock.jar;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
};
rootObject = 29B97313FDCFA39411CA2CEA;
}
diff --git a/camino/Makefile.in b/camino/Makefile.in
index fbd8f8e3a6b..916bc4a9f72 100644
--- a/camino/Makefile.in
+++ b/camino/Makefile.in
@@ -44,6 +44,7 @@ include $(DEPTH)/config/autoconf.mk
DIRS = \
IBPalette \
+ flashblock \
$(NULL)
APP_NAME = Camino
diff --git a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/classes.nib b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/classes.nib
index ffa24d175df..cb1d067a43c 100644
--- a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/classes.nib
+++ b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/classes.nib
@@ -18,6 +18,7 @@
addWhitelistSite = id;
clickEnableAdBlocking = id;
clickEnableAnnoyanceBlocker = id;
+ clickEnableFlashBlock = id;
clickEnableImageResizing = id;
clickEnableJS = id;
clickEnableJava = id;
@@ -37,6 +38,7 @@
mEditWhitelist = NSButton;
mEnableAdBlocking = NSButton;
mEnableAnnoyanceBlocker = NSButton;
+ mEnableFlashBlock = NSButton;
mEnableJS = NSButton;
mEnableJava = NSButton;
mEnablePlugins = NSButton;
diff --git a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/info.nib b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/info.nib
index aa5233133ae..75c61fd4cfd 100644
--- a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/info.nib
+++ b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/info.nib
@@ -3,17 +3,13 @@
IBDocumentLocation
- 2 4 356 240 0 0 1024 746
+ 5 7 356 240 0 0 1920 1178 IBFramework Version446.1IBOldestOS2
- IBOpenObjects
-
- 5
- IBSystem Version
- 8J135
+ 8L127IBUserGuides312
@@ -25,6 +21,16 @@
guidesLocked
+ 5
+
+ guideLocations
+
+ Vertical:297.000000
+ Vertical:297.000000
+
+ guidesLocked
+
+
diff --git a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/keyedobjects.nib b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/keyedobjects.nib
index 5761d16818a..d92e359bfd2 100644
Binary files a/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/keyedobjects.nib and b/camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/keyedobjects.nib differ
diff --git a/camino/PreferencePanes/WebFeatures/WebFeatures.h b/camino/PreferencePanes/WebFeatures/WebFeatures.h
index 64eebb567c6..1e9eeac9adc 100644
--- a/camino/PreferencePanes/WebFeatures/WebFeatures.h
+++ b/camino/PreferencePanes/WebFeatures/WebFeatures.h
@@ -58,6 +58,7 @@ class nsISupportsArray;
IBOutlet NSButton *mImageResize;
IBOutlet NSButton *mPreventAnimation;
IBOutlet NSButton *mEditWhitelist;
+ IBOutlet NSButton *mEnableFlashBlock;
IBOutlet id mWhitelistPanel;
IBOutlet ExtendedTableView* mWhitelistTable;
@@ -82,6 +83,7 @@ class nsISupportsArray;
-(IBAction) clickEnableImageResizing:(id)sender;
-(IBAction) clickPreventAnimation:(id)sender;
-(IBAction) editWhitelist:(id)sender;
+-(IBAction) clickEnableFlashBlock:(id)sender;
-(IBAction) clickEnableAnnoyanceBlocker:(id)sender;
-(void) setAnnoyingWindowPrefsTo:(BOOL)inValue;
diff --git a/camino/PreferencePanes/WebFeatures/WebFeatures.mm b/camino/PreferencePanes/WebFeatures/WebFeatures.mm
index a869cc56d95..893f1de6900 100644
--- a/camino/PreferencePanes/WebFeatures/WebFeatures.mm
+++ b/camino/PreferencePanes/WebFeatures/WebFeatures.mm
@@ -56,8 +56,9 @@
// but that requires linkage and extra search paths.
static NSString* XPCOMShutDownNotificationName = @"XPCOMShutDown";
-// needs to match the string in PreferenceManager.mm
+// need to match the strings in PreferenceManager.mm
static NSString* const AdBlockingChangedNotificationName = @"AdBlockingChanged";
+static NSString* const kFlashBlockChangedNotificationName = @"FlashBlockChanged";
// for camino.enable_plugins; needs to match string in BrowserWrapper.mm
static NSString* const kEnablePluginsChangedNotificationName = @"EnablePluginsChanged";
@@ -76,6 +77,8 @@ const int kAnnoyancePrefSome = 3;
-(NSString*)profilePath;
- (int)annoyingWindowPrefs;
- (int)preventAnimationCheckboxState;
+- (BOOL)isFlashBlockAllowed;
+- (void)updateFlashBlock;
@end
@@ -144,6 +147,15 @@ const int kAnnoyancePrefSome = 3;
BOOL enableAdBlock = [self getBooleanPref:"camino.enable_ad_blocking" withSuccess:&gotPref];
[mEnableAdBlocking setState:enableAdBlock];
+ // Only allow FlashBlock if dependencies are set correctly
+ BOOL flashBlockAllowed = [self isFlashBlockAllowed];
+ [mEnableFlashBlock setEnabled:flashBlockAllowed];
+
+ if (flashBlockAllowed) {
+ BOOL enableFlashBlock = [self getBooleanPref:"camino.enable_flashblock" withSuccess:nil];
+ [mEnableFlashBlock setState:(enableFlashBlock ? NSOnState : NSOffState)];
+ }
+
// Set inital values for tabfocus pref. Internally, it's a bitwise additive pref:
// bit 0 adds focus for text fields (not exposed in the UI, so not given a constant)
// bit 1 adds focus for other form elements (kFocusForms)
@@ -167,6 +179,9 @@ const int kAnnoyancePrefSome = 3;
-(IBAction) clickEnableJS:(id)sender
{
[self setPref:"javascript.enabled" toBoolean:([sender state] == NSOnState)];
+
+ // FlashBlock depends on Javascript so make sure to update the FlashBlock settings
+ [self updateFlashBlock];
}
//
@@ -188,6 +203,9 @@ const int kAnnoyancePrefSome = 3;
{
[self setPref:"camino.enable_plugins" toBoolean:([sender state] == NSOnState)];
[[NSNotificationCenter defaultCenter] postNotificationName:kEnablePluginsChangedNotificationName object:nil];
+
+ // FlashBlock depends on plug-ins so make sure to update the FlashBlock settings
+ [self updateFlashBlock];
}
//
@@ -235,6 +253,18 @@ const int kAnnoyancePrefSome = 3;
[self setPref:"image.animation_mode" toString:([sender state] ? @"once" : @"normal")];
}
+//
+// clickEnableFlashBlock:
+//
+// Enable and disable FlashBlock. When enabled, an icon is displayed and the
+// Flash animation plays when the user clicks it. When disabled, Flash plays automatically
+//
+-(IBAction) clickEnableFlashBlock:(id)sender
+{
+ [self setPref:"camino.enable_flashblock" toBoolean:([sender state] == NSOnState)];
+ [[NSNotificationCenter defaultCenter] postNotificationName:kFlashBlockChangedNotificationName object:nil];
+}
+
//
// populatePermissionCache:
//
@@ -501,4 +531,43 @@ const int kAnnoyancePrefSome = 3;
return [NSString stringWithUTF8String:nativePath.get()];
}
+//
+// isFlashBlockAllowed
+//
+// Checks whether FlashBlock can be enabled
+// FlashBlock only allowed if javascript and plug-ins enabled
+// NOTE: This code is duplicated in PreferenceManager.mm since the FlashBlock checkbox
+// settings are done by WebFeatures and stylesheet loading is done by PreferenceManager
+//
+-(BOOL) isFlashBlockAllowed
+{
+ BOOL gotPref = NO;
+ BOOL jsEnabled = [self getBooleanPref:"javascript.enabled" withSuccess:&gotPref] && gotPref;
+ BOOL pluginsEnabled = [self getBooleanPref:"camino.enable_plugins" withSuccess:&gotPref] || !gotPref;
+
+ return jsEnabled && pluginsEnabled;
+}
+
+//
+// updateFlashBlock
+//
+// Update the state of the FlashBlock checkbox
+//
+-(void) updateFlashBlock
+{
+ BOOL allowed = [self isFlashBlockAllowed];
+ [mEnableFlashBlock setEnabled:allowed];
+
+ // FlashBlock state can only change if it's already enabled
+ // since changing dependencies won't have affect on disabled FlashBlock
+ if (![self getBooleanPref:"camino.enable_flashblock" withSuccess:nil])
+ return;
+
+ // FlashBlock preference is enabled. Checkbox is on if FlashBlock also allowed
+ [mEnableFlashBlock setState:(allowed ? NSOnState : NSOffState)];
+
+ // Always send a notification, dependency verification is done by receiver.
+ [[NSNotificationCenter defaultCenter] postNotificationName:kFlashBlockChangedNotificationName object:nil];
+}
+
@end
diff --git a/camino/flashblock/Makefile.in b/camino/flashblock/Makefile.in
new file mode 100644
index 00000000000..7e8247772ea
--- /dev/null
+++ b/camino/flashblock/Makefile.in
@@ -0,0 +1,63 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is just a lowly Makefile.
+#
+# The Initial Developer of the Original Code is Google Inc.
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Mark Mentovai (Original Author)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH = ../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
+# The presence of jar.mn causes $(SOURCE_CHROME_DIR)/$(JAR_FILE).jar to be
+# built and $(SOURCE_CHROME_DIR)/installed-chrome.txt to be updated. Camino
+# uses $(TARGET_CHROME_DIR)/installed-chrome.txt instead, though, so copy
+# the jar and update the correct installed-chrome.txt file.
+
+SOURCE_CHROME_DIR = $(DIST)/bin/chrome
+TARGET_CHROME_DIR = $(DIST)/Embed/chrome
+INSTALLED_CHROME = $(TARGET_CHROME_DIR)/installed-chrome.txt
+CHROME_TYPE = content
+CHROME_PKG_NAME = flashblock
+JAR_FILE = $(CHROME_PKG_NAME)
+
+libs realchrome:: $(CHROME_DEPS)
+ chmod a-x $(INSTALLED_CHROME)
+ $(NSINSTALL) -t -m 0644 \
+ $(SOURCE_CHROME_DIR)/$(JAR_FILE).jar $(TARGET_CHROME_DIR)
+ $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \
+ $(INSTALLED_CHROME) 0 $(CHROME_TYPE) $(CHROME_PKG_NAME) $(JAR_FILE)
diff --git a/camino/flashblock/README b/camino/flashblock/README
new file mode 100644
index 00000000000..3742f6fcf74
--- /dev/null
+++ b/camino/flashblock/README
@@ -0,0 +1,10 @@
+Flash blocking for Camino is implemented using the FlashBlock extension
+from http://flashblock.mozdev.org/. FlashBlock is available under the
+MPL/GPL/LGPL tri-license. The files necessary for operation in Camino
+are placed in the content directory and referenced by the jar.mn
+manifest. A contents.rdf file is included to allow Camino to identify
+the contents of flashblock.jar.
+
+Camino's bundled FlashBlock extension is currently synchronized with
+FlashBlock 1.5.2 from
+http://downloads.mozdev.org/flashblock/flashblock-1.5.2.xpi.
diff --git a/camino/flashblock/content/authorware.png b/camino/flashblock/content/authorware.png
new file mode 100644
index 00000000000..fd562961256
Binary files /dev/null and b/camino/flashblock/content/authorware.png differ
diff --git a/camino/flashblock/content/contents.rdf b/camino/flashblock/content/contents.rdf
new file mode 100644
index 00000000000..97362a95a34
--- /dev/null
+++ b/camino/flashblock/content/contents.rdf
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/camino/flashblock/content/director.png b/camino/flashblock/content/director.png
new file mode 100644
index 00000000000..4da6cf9545e
Binary files /dev/null and b/camino/flashblock/content/director.png differ
diff --git a/camino/flashblock/content/flash.png b/camino/flashblock/content/flash.png
new file mode 100644
index 00000000000..61dc080dad1
Binary files /dev/null and b/camino/flashblock/content/flash.png differ
diff --git a/camino/flashblock/content/flashblock.css b/camino/flashblock/content/flashblock.css
new file mode 100644
index 00000000000..b31820a316e
--- /dev/null
+++ b/camino/flashblock/content/flashblock.css
@@ -0,0 +1,79 @@
+/*
+ * Flash Click to View by Ted Mielczarek (luser_mozilla@perilith.com)
+ * Original code by Jesse Ruderman (jruderman@hmc.edu)
+ * taken from http://www.squarefree.com/userstyles/xbl.html
+ *
+ * Change XBL binding for