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

Side by Side Diff: chrome/browser/cocoa/content_settings_dialog_controller.mm

Issue 2835031: Rename GeolocationExceptionsView, make it more reusable. (Closed)
Patch Set: comments Created 10 years, 5 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 unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/browser.h" 11 #include "chrome/browser/browser.h"
12 #include "chrome/browser/browser_window.h" 12 #include "chrome/browser/browser_window.h"
13 #import "chrome/browser/cocoa/content_exceptions_window_controller.h" 13 #import "chrome/browser/cocoa/content_exceptions_window_controller.h"
14 #import "chrome/browser/cocoa/cookies_window_controller.h" 14 #import "chrome/browser/cocoa/cookies_window_controller.h"
15 #import "chrome/browser/cocoa/geolocation_exceptions_window_controller.h" 15 #import "chrome/browser/cocoa/simple_content_exceptions_window_controller.h"
16 #import "chrome/browser/cocoa/l10n_util.h" 16 #import "chrome/browser/cocoa/l10n_util.h"
17 #import "chrome/browser/geolocation/geolocation_content_settings_map.h" 17 #import "chrome/browser/geolocation/geolocation_content_settings_map.h"
18 #import "chrome/browser/geolocation/geolocation_exceptions_table_model.h"
18 #import "chrome/browser/host_content_settings_map.h" 19 #import "chrome/browser/host_content_settings_map.h"
19 #include "chrome/browser/pref_service.h" 20 #include "chrome/browser/pref_service.h"
20 #include "chrome/browser/profile.h" 21 #include "chrome/browser/profile.h"
21 #include "chrome/common/notification_service.h" 22 #include "chrome/common/notification_service.h"
22 #include "chrome/common/pref_names.h" 23 #include "chrome/common/pref_names.h"
23 #include "chrome/common/url_constants.h" 24 #include "chrome/common/url_constants.h"
24 #include "grit/locale_settings.h" 25 #include "grit/locale_settings.h"
25 26
26 namespace { 27 namespace {
27 28
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 [self showExceptionsForType:CONTENT_SETTINGS_TYPE_PLUGINS]; 318 [self showExceptionsForType:CONTENT_SETTINGS_TYPE_PLUGINS];
318 } 319 }
319 320
320 - (IBAction)showPopupsExceptions:(id)sender { 321 - (IBAction)showPopupsExceptions:(id)sender {
321 [self showExceptionsForType:CONTENT_SETTINGS_TYPE_POPUPS]; 322 [self showExceptionsForType:CONTENT_SETTINGS_TYPE_POPUPS];
322 } 323 }
323 324
324 - (IBAction)showGeolocationExceptions:(id)sender { 325 - (IBAction)showGeolocationExceptions:(id)sender {
325 GeolocationContentSettingsMap* settingsMap = 326 GeolocationContentSettingsMap* settingsMap =
326 profile_->GetGeolocationContentSettingsMap(); 327 profile_->GetGeolocationContentSettingsMap();
327 [[GeolocationExceptionsWindowController controllerWithSettingsMap:settingsMap] 328 GeolocationExceptionsTableModel* model = // Freed by window controller.
329 new GeolocationExceptionsTableModel(settingsMap);
330 [[SimpleContentExceptionsWindowController controllerWithTableModel:model]
328 attachSheetTo:[self window]]; 331 attachSheetTo:[self window]];
329 } 332 }
330 333
331 - (void)showExceptionsForType:(ContentSettingsType)settingsType { 334 - (void)showExceptionsForType:(ContentSettingsType)settingsType {
332 HostContentSettingsMap* settingsMap = profile_->GetHostContentSettingsMap(); 335 HostContentSettingsMap* settingsMap = profile_->GetHostContentSettingsMap();
333 [[ContentExceptionsWindowController controllerForType:settingsType 336 [[ContentExceptionsWindowController controllerForType:settingsType
334 settingsMap:settingsMap] 337 settingsMap:settingsMap]
335 attachSheetTo:[self window]]; 338 attachSheetTo:[self window]];
336 } 339 }
337 340
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 [self willChangeValueForKey:@"popupsEnabledIndex"]; 462 [self willChangeValueForKey:@"popupsEnabledIndex"];
460 [self didChangeValueForKey:@"popupsEnabledIndex"]; 463 [self didChangeValueForKey:@"popupsEnabledIndex"];
461 } 464 }
462 if (*prefName == prefs::kGeolocationDefaultContentSetting) { 465 if (*prefName == prefs::kGeolocationDefaultContentSetting) {
463 [self willChangeValueForKey:@"geolocationSettingIndex"]; 466 [self willChangeValueForKey:@"geolocationSettingIndex"];
464 [self didChangeValueForKey:@"geolocationSettingIndex"]; 467 [self didChangeValueForKey:@"geolocationSettingIndex"];
465 } 468 }
466 } 469 }
467 470
468 @end 471 @end
OLDNEW
« no previous file with comments | « chrome/app/nibs/SimpleContentExceptionsWindow.xib ('k') | chrome/browser/cocoa/simple_content_exceptions_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698