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

Unified Diff: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm

Issue 2171713002: Safe browsing subresource filter bubble UI skeleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Verified xib file Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
index d22342117b84979dbb9ae8b600294c0caf02bb3f..f11960d84fe3d596b5f92d69e395a2ec9bb703f6 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
@@ -205,6 +205,7 @@ class ContentSettingBubbleWebContentsObserverBridge
webContents:(content::WebContents*)webContents
parentWindow:(NSWindow*)parentWindow
anchoredAt:(NSPoint)anchoredAt;
+- (NSString*)getNibPathForModel:(ContentSettingBubbleModel*)model;
- (NSButton*)hyperlinkButtonWithFrame:(NSRect)frame
title:(NSString*)title
icon:(NSImage*)icon
@@ -268,6 +269,20 @@ const ContentTypeToNibPath kNibPaths[] = {
observerBridge_.reset(
new ContentSettingBubbleWebContentsObserverBridge(webContents, self));
+ NSString* nibPath = [self getNibPathForModel:model.get()];
+
+ DCHECK_NE(0u, [nibPath length]);
+
+ if ((self = [super initWithWindowNibPath:nibPath
+ parentWindow:parentWindow
+ anchoredAt:anchoredAt])) {
+ contentSettingBubbleModel_.reset(model.release());
+ [self showWindow:nil];
+ }
+ return self;
+}
+
+- (NSString*)getNibPathForModel:(ContentSettingBubbleModel*)model {
NSString* nibPath = @"";
ContentSettingSimpleBubbleModel* simple_bubble = model->AsSimpleBubbleModel();
@@ -285,15 +300,9 @@ const ContentTypeToNibPath kNibPaths[] = {
if (model->AsMediaStreamBubbleModel())
nibPath = @"ContentBlockedMedia";
- DCHECK_NE(0u, [nibPath length]);
-
- if ((self = [super initWithWindowNibPath:nibPath
- parentWindow:parentWindow
- anchoredAt:anchoredAt])) {
- contentSettingBubbleModel_.reset(model.release());
- [self showWindow:nil];
- }
- return self;
+ if (model->AsSubresourceFilterBubbleModel())
+ nibPath = @"ContentSubresourceFilter";
+ return nibPath;
}
- (void)dealloc {

Powered by Google App Engine
This is Rietveld 408576698