OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H_ |
6 #define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/ui/website_settings/permission_menu_model.h" | 13 #include "chrome/browser/ui/website_settings/permission_menu_model.h" |
13 #include "components/content_settings/core/common/content_settings.h" | 14 #include "components/content_settings/core/common/content_settings.h" |
14 | 15 |
15 @class MenuController; | 16 @class MenuController; |
16 | 17 |
17 @interface PermissionSelectorButton : NSPopUpButton { | 18 @interface PermissionSelectorButton : NSPopUpButton { |
18 @private | 19 @private |
19 scoped_ptr<PermissionMenuModel> menuModel_; | 20 std::unique_ptr<PermissionMenuModel> menuModel_; |
20 base::scoped_nsobject<MenuController> menuController_; | 21 base::scoped_nsobject<MenuController> menuController_; |
21 } | 22 } |
22 | 23 |
23 // Designated initializer. | 24 // Designated initializer. |
24 - (id)initWithPermissionInfo: | 25 - (id)initWithPermissionInfo: |
25 (const WebsiteSettingsUI::PermissionInfo&)permissionInfo | 26 (const WebsiteSettingsUI::PermissionInfo&)permissionInfo |
26 forURL:(const GURL&)url | 27 forURL:(const GURL&)url |
27 withCallback:(PermissionMenuModel::ChangeCallback)callback; | 28 withCallback:(PermissionMenuModel::ChangeCallback)callback; |
28 | 29 |
29 // Returns the largest possible size given all of the items in the menu. | 30 // Returns the largest possible size given all of the items in the menu. |
30 - (CGFloat)maxTitleWidthForContentSettingsType:(ContentSettingsType)type | 31 - (CGFloat)maxTitleWidthForContentSettingsType:(ContentSettingsType)type |
31 withDefaultSetting:(ContentSetting)defaultSetting; | 32 withDefaultSetting:(ContentSetting)defaultSetting; |
32 | 33 |
33 @end | 34 @end |
34 | 35 |
35 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H
_ | 36 #endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_PERMISSION_SELECTOR_BUTTON_H
_ |
OLD | NEW |