| 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_exceptions_window_controller.h" | 5 #import "chrome/browser/cocoa/content_exceptions_window_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
| 9 #include "app/table_model_observer.h" | 9 #include "app/table_model_observer.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 NSString* nibpath = | 171 NSString* nibpath = |
| 172 [mac_util::MainAppBundle() pathForResource:@"ContentExceptionsWindow" | 172 [mac_util::MainAppBundle() pathForResource:@"ContentExceptionsWindow" |
| 173 ofType:@"nib"]; | 173 ofType:@"nib"]; |
| 174 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 174 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
| 175 settingsType_ = settingsType; | 175 settingsType_ = settingsType; |
| 176 settingsMap_ = settingsMap; | 176 settingsMap_ = settingsMap; |
| 177 otrSettingsMap_ = otrSettingsMap; | 177 otrSettingsMap_ = otrSettingsMap; |
| 178 model_.reset(new ContentExceptionsTableModel( | 178 model_.reset(new ContentExceptionsTableModel( |
| 179 settingsMap_, otrSettingsMap_, settingsType_)); | 179 settingsMap_, otrSettingsMap_, settingsType_)); |
| 180 showSession_ = settingsType_ == CONTENT_SETTINGS_TYPE_COOKIES; | 180 showSession_ = settingsType_ == CONTENT_SETTINGS_TYPE_COOKIES; |
| 181 disableCookiePrompt_ = CommandLine::ForCurrentProcess()->HasSwitch( | 181 disableCookiePrompt_ = !CommandLine::ForCurrentProcess()->HasSwitch( |
| 182 switches::kDisableCookiePrompt); | 182 switches::kEnableCookiePrompt); |
| 183 otrAllowed_ = otrSettingsMap != NULL; | 183 otrAllowed_ = otrSettingsMap != NULL; |
| 184 tableObserver_.reset(new UpdatingContentSettingsObserver(self)); | 184 tableObserver_.reset(new UpdatingContentSettingsObserver(self)); |
| 185 updatesEnabled_ = YES; | 185 updatesEnabled_ = YES; |
| 186 | 186 |
| 187 // TODO(thakis): autoremember window rect. | 187 // TODO(thakis): autoremember window rect. |
| 188 // TODO(thakis): sorting support. | 188 // TODO(thakis): sorting support. |
| 189 } | 189 } |
| 190 return self; | 190 return self; |
| 191 } | 191 } |
| 192 | 192 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 - (size_t)indexForSetting:(ContentSetting)setting { | 542 - (size_t)indexForSetting:(ContentSetting)setting { |
| 543 for (size_t i = 0; i < [self menuItemCount]; ++i) { | 543 for (size_t i = 0; i < [self menuItemCount]; ++i) { |
| 544 if ([self settingForIndex:i] == setting) | 544 if ([self settingForIndex:i] == setting) |
| 545 return i; | 545 return i; |
| 546 } | 546 } |
| 547 NOTREACHED(); | 547 NOTREACHED(); |
| 548 return 0; | 548 return 0; |
| 549 } | 549 } |
| 550 | 550 |
| 551 @end | 551 @end |
| OLD | NEW |