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

Side by Side Diff: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h

Issue 2826233002: [subresource_filter] Mac UI updated and xib replaced with code based layout. (Closed)
Patch Set: Feedback addressed. Created 3 years, 7 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) 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>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 bool operator()(NSPopUpButton *const a, NSPopUpButton *const b) const { 48 bool operator()(NSPopUpButton *const a, NSPopUpButton *const b) const {
49 return [a tag] < [b tag]; 49 return [a tag] < [b tag];
50 } 50 }
51 }; 51 };
52 using MediaMenuPartsMap = 52 using MediaMenuPartsMap =
53 std::map<NSPopUpButton*, std::unique_ptr<MediaMenuParts>, compare_button>; 53 std::map<NSPopUpButton*, std::unique_ptr<MediaMenuParts>, compare_button>;
54 } // namespace content_setting_bubble 54 } // namespace content_setting_bubble
55 55
56 // Manages a "content blocked" bubble. 56 // Manages a "content blocked" bubble.
57 @interface ContentSettingBubbleController : OmniboxDecorationBubbleController { 57 @interface ContentSettingBubbleController : OmniboxDecorationBubbleController {
58 @private 58 @protected
59 IBOutlet NSTextField* titleLabel_; 59 IBOutlet NSTextField* titleLabel_;
60 IBOutlet NSTextField* messageLabel_; 60 IBOutlet NSTextField* messageLabel_;
61 IBOutlet NSMatrix* allowBlockRadioGroup_; 61 IBOutlet NSMatrix* allowBlockRadioGroup_;
62 62
63 IBOutlet NSButton* manageButton_; 63 IBOutlet NSButton* manageButton_;
64 IBOutlet NSButton* doneButton_; 64 IBOutlet NSButton* doneButton_;
65 IBOutlet NSButton* loadButton_; 65 IBOutlet NSButton* loadButton_;
66 66
67 std::unique_ptr<ContentSettingBubbleModel> contentSettingBubbleModel_;
68
69 @private
67 // The container for the bubble contents of the geolocation bubble. 70 // The container for the bubble contents of the geolocation bubble.
68 IBOutlet NSView* contentsContainer_; 71 IBOutlet NSView* contentsContainer_;
69 72
70 IBOutlet NSTextField* blockedResourcesField_; 73 IBOutlet NSTextField* blockedResourcesField_;
71 74
72 std::unique_ptr<ContentSettingBubbleModel> contentSettingBubbleModel_;
73 std::unique_ptr<ContentSettingBubbleWebContentsObserverBridge> 75 std::unique_ptr<ContentSettingBubbleWebContentsObserverBridge>
74 observerBridge_; 76 observerBridge_;
75 content_setting_bubble::PopupLinks popupLinks_; 77 content_setting_bubble::PopupLinks popupLinks_;
76 content_setting_bubble::MediaMenuPartsMap mediaMenus_; 78 content_setting_bubble::MediaMenuPartsMap mediaMenus_;
77 79
78 // The omnibox icon the bubble is anchored to. 80 // The omnibox icon the bubble is anchored to.
79 ContentSettingDecoration* decoration_; // weak 81 ContentSettingDecoration* decoration_; // weak
80 } 82 }
81 83
84 // Initializes the controller using the model. Takes ownership of
85 // |settingsBubbleModel| but not of the other objects.
Robert Sesek 2017/05/03 22:05:11 Add a note that this is used for subclasses and th
shivanisha 2017/05/04 20:20:57 done
86 - (id)initWithModel:(ContentSettingBubbleModel*)settingsBubbleModel
87 webContents:(content::WebContents*)webContents
88 window:(NSWindow*)window
89 parentWindow:(NSWindow*)parentWindow
90 decoration:(ContentSettingDecoration*)decoration
91 anchoredAt:(NSPoint)anchoredAt;
92
82 // Creates and shows a content blocked bubble. Takes ownership of 93 // Creates and shows a content blocked bubble. Takes ownership of
83 // |contentSettingBubbleModel| but not of the other objects. 94 // |contentSettingBubbleModel| but not of the other objects.
84 + (ContentSettingBubbleController*) 95 + (ContentSettingBubbleController*)
85 showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel 96 showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel
86 webContents:(content::WebContents*)webContents 97 webContents:(content::WebContents*)webContents
87 parentWindow:(NSWindow*)parentWindow 98 parentWindow:(NSWindow*)parentWindow
88 decoration:(ContentSettingDecoration*)decoration 99 decoration:(ContentSettingDecoration*)decoration
89 anchoredAt:(NSPoint)anchoredAt; 100 anchoredAt:(NSPoint)anchoredAt;
90 101
102 // Initializes the layout of all the UI elements.
103 - (void)layoutView;
104
91 // Callback for the "don't block / continue blocking" radio group. 105 // Callback for the "don't block / continue blocking" radio group.
92 - (IBAction)allowBlockToggled:(id)sender; 106 - (IBAction)allowBlockToggled:(id)sender;
93 107
94 // Callback for "close" button. 108 // Callback for "close" button.
95 - (IBAction)closeBubble:(id)sender; 109 - (IBAction)closeBubble:(id)sender;
96 110
97 // Callback for "manage" button. 111 // Callback for "manage" button.
98 - (IBAction)manageBlocking:(id)sender; 112 - (IBAction)manageBlocking:(id)sender;
99 113
100 // Callback for "info" link. 114 // Callback for "info" link.
(...skipping 11 matching lines...) Expand all
112 @end 126 @end
113 127
114 @interface ContentSettingBubbleController (TestingAPI) 128 @interface ContentSettingBubbleController (TestingAPI)
115 129
116 // Returns the weak reference to the |mediaMenus_|. 130 // Returns the weak reference to the |mediaMenus_|.
117 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus; 131 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus;
118 132
119 @end 133 @end
120 134
121 #endif // CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA _H_ 135 #endif // CHROME_BROWSER_UI_COCOA_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_COCOA _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698