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