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

Unified Diff: chrome/browser/cocoa/preferences_window_controller.mm

Issue 600133: Mac: Content blocked icons. (Closed)
Patch Set: comments andybons Created 10 years, 10 months 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
« no previous file with comments | « chrome/browser/cocoa/location_bar_view_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/preferences_window_controller.mm
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 357824dc818fd898c256e6124a0883789754ae74..f04a8bed22fd0b7826c3aa125ddff30200da0f70 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -32,6 +32,7 @@
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/options_window.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/host_content_settings_map.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/session_startup_pref.h"
#include "chrome/browser/shell_integration.h"
@@ -1422,6 +1423,38 @@ const int kDisabledIndex = 1;
chrome_browser_net::EnableDnsPrefetch(value ? true : false);
}
+- (BOOL)blockImages {
+ return profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_IMAGES) != CONTENT_SETTING_ALLOW;
+}
+
+- (void)setBlockImages:(BOOL)value {
+// profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+// content_type_,
+// CONTENT_SETTINGS_TYPE_IMAGES,
+// value ? CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW);
+ profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ value ? CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW);
+// profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+// CONTENT_SETTINGS_TYPE_PLUGINS,
+// value ? CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW);
+
+// blockImages_.SetValue(value ? true : false);
+}
+
+- (BOOL)blockJavaScript {
+ return profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_JAVASCRIPT) != CONTENT_SETTING_ALLOW;
+}
+
+- (void)setBlockJavaScript:(BOOL)value {
+ profile_->GetHostContentSettingsMap()->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_JAVASCRIPT,
+ value ? CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW);
+}
+
+
// Returns whether the safe browsing checkbox should be checked based on the
// preference.
- (BOOL)safeBrowsing {
« no previous file with comments | « chrome/browser/cocoa/location_bar_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698