OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" | 5 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 GeolocationContentSettingsMap* settingsMap = | 326 GeolocationContentSettingsMap* settingsMap = |
327 profile_->GetGeolocationContentSettingsMap(); | 327 profile_->GetGeolocationContentSettingsMap(); |
328 GeolocationExceptionsTableModel* model = // Freed by window controller. | 328 GeolocationExceptionsTableModel* model = // Freed by window controller. |
329 new GeolocationExceptionsTableModel(settingsMap); | 329 new GeolocationExceptionsTableModel(settingsMap); |
330 [[SimpleContentExceptionsWindowController controllerWithTableModel:model] | 330 [[SimpleContentExceptionsWindowController controllerWithTableModel:model] |
331 attachSheetTo:[self window]]; | 331 attachSheetTo:[self window]]; |
332 } | 332 } |
333 | 333 |
334 - (void)showExceptionsForType:(ContentSettingsType)settingsType { | 334 - (void)showExceptionsForType:(ContentSettingsType)settingsType { |
335 HostContentSettingsMap* settingsMap = profile_->GetHostContentSettingsMap(); | 335 HostContentSettingsMap* settingsMap = profile_->GetHostContentSettingsMap(); |
| 336 HostContentSettingsMap* offTheRecordSettingsMap = |
| 337 profile_->HasOffTheRecordProfile() ? |
| 338 profile_->GetOffTheRecordProfile()->GetHostContentSettingsMap() : |
| 339 NULL; |
336 [[ContentExceptionsWindowController controllerForType:settingsType | 340 [[ContentExceptionsWindowController controllerForType:settingsType |
337 settingsMap:settingsMap] | 341 settingsMap:settingsMap |
| 342 otrSettingsMap:offTheRecordSettingsMap] |
338 attachSheetTo:[self window]]; | 343 attachSheetTo:[self window]]; |
339 } | 344 } |
340 | 345 |
341 - (void)setImagesEnabledIndex:(NSInteger)value { | 346 - (void)setImagesEnabledIndex:(NSInteger)value { |
342 ContentSetting setting = value == kContentSettingsEnabledIndex ? | 347 ContentSetting setting = value == kContentSettingsEnabledIndex ? |
343 CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 348 CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
344 ContentSettingsDialogControllerInternal::PrefObserverDisabler | 349 ContentSettingsDialogControllerInternal::PrefObserverDisabler |
345 disabler(observer_.get()); | 350 disabler(observer_.get()); |
346 profile_->GetHostContentSettingsMap()->SetDefaultContentSetting( | 351 profile_->GetHostContentSettingsMap()->SetDefaultContentSetting( |
347 CONTENT_SETTINGS_TYPE_IMAGES, setting); | 352 CONTENT_SETTINGS_TYPE_IMAGES, setting); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 [self willChangeValueForKey:@"popupsEnabledIndex"]; | 467 [self willChangeValueForKey:@"popupsEnabledIndex"]; |
463 [self didChangeValueForKey:@"popupsEnabledIndex"]; | 468 [self didChangeValueForKey:@"popupsEnabledIndex"]; |
464 } | 469 } |
465 if (*prefName == prefs::kGeolocationDefaultContentSetting) { | 470 if (*prefName == prefs::kGeolocationDefaultContentSetting) { |
466 [self willChangeValueForKey:@"geolocationSettingIndex"]; | 471 [self willChangeValueForKey:@"geolocationSettingIndex"]; |
467 [self didChangeValueForKey:@"geolocationSettingIndex"]; | 472 [self didChangeValueForKey:@"geolocationSettingIndex"]; |
468 } | 473 } |
469 } | 474 } |
470 | 475 |
471 @end | 476 @end |
OLD | NEW |