| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #import "chrome/browser/ui/cocoa/omnibox_decoration_bubble_controller.h" | 14 #import "chrome/browser/ui/cocoa/omnibox_decoration_bubble_controller.h" |
| 15 #include "content/public/common/media_stream_request.h" | 15 #include "content/public/common/media_stream_request.h" |
| 16 #import "ui/base/cocoa/touch_bar_forward_declarations.h" |
| 16 | 17 |
| 17 class ContentSettingBubbleModel; | 18 class ContentSettingBubbleModel; |
| 18 class ContentSettingBubbleWebContentsObserverBridge; | 19 class ContentSettingBubbleWebContentsObserverBridge; |
| 19 class ContentSettingDecoration; | 20 class ContentSettingDecoration; |
| 20 class ContentSettingMediaMenuModel; | 21 class ContentSettingMediaMenuModel; |
| 21 @class InfoBubbleView; | 22 @class InfoBubbleView; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class WebContents; | 25 class WebContents; |
| 25 } | 26 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 47 struct compare_button { | 48 struct compare_button { |
| 48 bool operator()(NSPopUpButton *const a, NSPopUpButton *const b) const { | 49 bool operator()(NSPopUpButton *const a, NSPopUpButton *const b) const { |
| 49 return [a tag] < [b tag]; | 50 return [a tag] < [b tag]; |
| 50 } | 51 } |
| 51 }; | 52 }; |
| 52 using MediaMenuPartsMap = | 53 using MediaMenuPartsMap = |
| 53 std::map<NSPopUpButton*, std::unique_ptr<MediaMenuParts>, compare_button>; | 54 std::map<NSPopUpButton*, std::unique_ptr<MediaMenuParts>, compare_button>; |
| 54 } // namespace content_setting_bubble | 55 } // namespace content_setting_bubble |
| 55 | 56 |
| 56 // Manages a "content blocked" bubble. | 57 // Manages a "content blocked" bubble. |
| 57 @interface ContentSettingBubbleController : OmniboxDecorationBubbleController { | 58 @interface ContentSettingBubbleController |
| 59 : OmniboxDecorationBubbleController<NSTouchBarDelegate> { |
| 58 @protected | 60 @protected |
| 59 IBOutlet NSTextField* titleLabel_; | 61 IBOutlet NSTextField* titleLabel_; |
| 60 IBOutlet NSTextField* messageLabel_; | 62 IBOutlet NSTextField* messageLabel_; |
| 61 IBOutlet NSMatrix* allowBlockRadioGroup_; | 63 IBOutlet NSMatrix* allowBlockRadioGroup_; |
| 62 | 64 |
| 63 IBOutlet NSButton* manageButton_; | 65 IBOutlet NSButton* manageButton_; |
| 64 IBOutlet NSButton* doneButton_; | 66 IBOutlet NSButton* doneButton_; |
| 65 IBOutlet NSButton* loadButton_; | 67 IBOutlet NSButton* loadButton_; |
| 66 | 68 |
| 67 std::unique_ptr<ContentSettingBubbleModel> contentSettingBubbleModel_; | 69 std::unique_ptr<ContentSettingBubbleModel> contentSettingBubbleModel_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 94 | 96 |
| 95 // Creates and shows a content blocked bubble. Takes ownership of | 97 // Creates and shows a content blocked bubble. Takes ownership of |
| 96 // |contentSettingBubbleModel| but not of the other objects. | 98 // |contentSettingBubbleModel| but not of the other objects. |
| 97 + (ContentSettingBubbleController*) | 99 + (ContentSettingBubbleController*) |
| 98 showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel | 100 showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel |
| 99 webContents:(content::WebContents*)webContents | 101 webContents:(content::WebContents*)webContents |
| 100 parentWindow:(NSWindow*)parentWindow | 102 parentWindow:(NSWindow*)parentWindow |
| 101 decoration:(ContentSettingDecoration*)decoration | 103 decoration:(ContentSettingDecoration*)decoration |
| 102 anchoredAt:(NSPoint)anchoredAt; | 104 anchoredAt:(NSPoint)anchoredAt; |
| 103 | 105 |
| 106 // Override to customize the touch bar. |
| 107 - (NSTouchBar*)makeTouchBar; |
| 108 |
| 104 // Initializes the layout of all the UI elements. | 109 // Initializes the layout of all the UI elements. |
| 105 - (void)layoutView; | 110 - (void)layoutView; |
| 106 | 111 |
| 107 // Callback for the "don't block / continue blocking" radio group. | 112 // Callback for the "don't block / continue blocking" radio group. |
| 108 - (IBAction)allowBlockToggled:(id)sender; | 113 - (IBAction)allowBlockToggled:(id)sender; |
| 109 | 114 |
| 110 // Callback for "close" button. | 115 // Callback for "close" button. |
| 111 - (IBAction)closeBubble:(id)sender; | 116 - (IBAction)closeBubble:(id)sender; |
| 112 | 117 |
| 113 // Callback for "manage" button. | 118 // Callback for "manage" button. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 128 @end | 133 @end |
| 129 | 134 |
| 130 @interface ContentSettingBubbleController (TestingAPI) | 135 @interface ContentSettingBubbleController (TestingAPI) |
| 131 | 136 |
| 132 // Returns the weak reference to the |mediaMenus_|. | 137 // Returns the weak reference to the |mediaMenus_|. |
| 133 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus; | 138 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus; |
| 134 | 139 |
| 135 @end | 140 @end |
| 136 | 141 |
| 137 #endif // CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA
_H_ | 142 #endif // CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA
_H_ |
| OLD | NEW |