summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/geolocation_exceptions_window_controller.h
blob: f93b9afe60ce6d06e4d4eae4ae3bc15b7e6fddfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Cocoa/Cocoa.h>

#include "base/cocoa_protocols_mac.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/geolocation/geolocation_content_settings_map.h"

class GeolocationContentSettingsTableModel;
class GeolocationObserverBridge;

// Controller for the geolocation exception dialog.
@interface GeolocationExceptionsWindowController : NSWindowController
                                                   <NSWindowDelegate,
                                                    NSTableViewDataSource,
                                                    NSTableViewDelegate> {
 @private
  IBOutlet NSTableView* tableView_;
  IBOutlet NSButton* removeButton_;
  IBOutlet NSButton* removeAllButton_;
  IBOutlet NSButton* doneButton_;

  GeolocationContentSettingsMap* settingsMap_;  // weak
  scoped_ptr<GeolocationContentSettingsTableModel> model_;
  scoped_ptr<GeolocationObserverBridge> tableObserver_;
}

// Shows or makes frontmost the geolocation exceptions window.
// Changes made by the user in the window are persisted in |settingsMap|.
+ (id)controllerWithSettingsMap:(GeolocationContentSettingsMap*)settingsMap;

// Sets the minimum width of the sheet and resizes it if necessary.
- (void)setMinWidth:(CGFloat)minWidth;

- (void)attachSheetTo:(NSWindow*)window;
- (IBAction)closeSheet:(id)sender;

- (IBAction)removeException:(id)sender;
- (IBAction)removeAllExceptions:(id)sender;

@end