| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 - (void)prefChanged:(std::wstring*)prefName; | 67 - (void)prefChanged:(std::wstring*)prefName; |
| 68 | 68 |
| 69 @end | 69 @end |
| 70 | 70 |
| 71 namespace ContentSettingsDialogControllerInternal { | 71 namespace ContentSettingsDialogControllerInternal { |
| 72 | 72 |
| 73 // A C++ class registered for changes in preferences. | 73 // A C++ class registered for changes in preferences. |
| 74 class PrefObserverBridge : public NotificationObserver { | 74 class PrefObserverBridge : public NotificationObserver { |
| 75 public: | 75 public: |
| 76 PrefObserverBridge(ContentSettingsDialogController* controller) | 76 PrefObserverBridge(ContentSettingsDialogController* controller) |
| 77 : controller_(controller) {} | 77 : controller_(controller), disabled_(false) {} |
| 78 | 78 |
| 79 virtual ~PrefObserverBridge() {} | 79 virtual ~PrefObserverBridge() {} |
| 80 | 80 |
| 81 virtual void Observe(NotificationType type, | 81 virtual void Observe(NotificationType type, |
| 82 const NotificationSource& source, | 82 const NotificationSource& source, |
| 83 const NotificationDetails& details) { | 83 const NotificationDetails& details) { |
| 84 if (!disabled_ && type == NotificationType::PREF_CHANGED) { | 84 if (!disabled_ && type == NotificationType::PREF_CHANGED) { |
| 85 [controller_ prefChanged:Details<std::wstring>(details).ptr()]; | 85 [controller_ prefChanged:Details<std::wstring>(details).ptr()]; |
| 86 } | 86 } |
| 87 } | 87 } |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 [self willChangeValueForKey:@"popupsEnabledIndex"]; | 476 [self willChangeValueForKey:@"popupsEnabledIndex"]; |
| 477 [self didChangeValueForKey:@"popupsEnabledIndex"]; | 477 [self didChangeValueForKey:@"popupsEnabledIndex"]; |
| 478 } | 478 } |
| 479 if (*prefName == prefs::kGeolocationDefaultContentSetting) { | 479 if (*prefName == prefs::kGeolocationDefaultContentSetting) { |
| 480 [self willChangeValueForKey:@"geolocationSettingIndex"]; | 480 [self willChangeValueForKey:@"geolocationSettingIndex"]; |
| 481 [self didChangeValueForKey:@"geolocationSettingIndex"]; | 481 [self didChangeValueForKey:@"geolocationSettingIndex"]; |
| 482 } | 482 } |
| 483 } | 483 } |
| 484 | 484 |
| 485 @end | 485 @end |
| OLD | NEW |