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/ui/cocoa/content_exceptions_window_controller.h" | 5 #import "chrome/browser/ui/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" |
11 #import "base/mac_util.h" | 11 #import "base/mac/mac_util.h" |
12 #import "base/scoped_nsobject.h" | 12 #import "base/scoped_nsobject.h" |
13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
14 #include "chrome/browser/content_exceptions_table_model.h" | 14 #include "chrome/browser/content_exceptions_table_model.h" |
15 #include "chrome/browser/content_setting_combo_model.h" | 15 #include "chrome/browser/content_setting_combo_model.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/notification_registrar.h" | 17 #include "chrome/common/notification_registrar.h" |
18 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
20 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 20 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
21 | 21 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 settingsMap:settingsMap | 144 settingsMap:settingsMap |
145 otrSettingsMap:otrSettingsMap]; | 145 otrSettingsMap:otrSettingsMap]; |
146 } | 146 } |
147 return g_exceptionWindows[settingsType]; | 147 return g_exceptionWindows[settingsType]; |
148 } | 148 } |
149 | 149 |
150 - (id)initWithType:(ContentSettingsType)settingsType | 150 - (id)initWithType:(ContentSettingsType)settingsType |
151 settingsMap:(HostContentSettingsMap*)settingsMap | 151 settingsMap:(HostContentSettingsMap*)settingsMap |
152 otrSettingsMap:(HostContentSettingsMap*)otrSettingsMap { | 152 otrSettingsMap:(HostContentSettingsMap*)otrSettingsMap { |
153 NSString* nibpath = | 153 NSString* nibpath = |
154 [mac_util::MainAppBundle() pathForResource:@"ContentExceptionsWindow" | 154 [base::mac::MainAppBundle() pathForResource:@"ContentExceptionsWindow" |
155 ofType:@"nib"]; | 155 ofType:@"nib"]; |
156 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 156 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
157 settingsType_ = settingsType; | 157 settingsType_ = settingsType; |
158 settingsMap_ = settingsMap; | 158 settingsMap_ = settingsMap; |
159 otrSettingsMap_ = otrSettingsMap; | 159 otrSettingsMap_ = otrSettingsMap; |
160 model_.reset(new ContentExceptionsTableModel( | 160 model_.reset(new ContentExceptionsTableModel( |
161 settingsMap_, otrSettingsMap_, settingsType_)); | 161 settingsMap_, otrSettingsMap_, settingsType_)); |
162 popup_model_.reset(new ContentSettingComboModel(settingsType_)); | 162 popup_model_.reset(new ContentSettingComboModel(settingsType_)); |
163 otrAllowed_ = otrSettingsMap != NULL; | 163 otrAllowed_ = otrSettingsMap != NULL; |
164 tableObserver_.reset(new UpdatingContentSettingsObserver(self)); | 164 tableObserver_.reset(new UpdatingContentSettingsObserver(self)); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 // The model caches its data, meaning we need to recreate it on every change. | 481 // The model caches its data, meaning we need to recreate it on every change. |
482 model_.reset(new ContentExceptionsTableModel( | 482 model_.reset(new ContentExceptionsTableModel( |
483 settingsMap_, otrSettingsMap_, settingsType_)); | 483 settingsMap_, otrSettingsMap_, settingsType_)); |
484 | 484 |
485 [tableView_ reloadData]; | 485 [tableView_ reloadData]; |
486 [self adjustEditingButtons]; | 486 [self adjustEditingButtons]; |
487 } | 487 } |
488 | 488 |
489 @end | 489 @end |
OLD | NEW |