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

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

Issue 2542173002: [Mac] Omnibox icons active states (Closed)
Patch Set: Created 4 years 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 a83d26e2e827e5ce2a01716b721f858ed115e652..d6efcae5ba30e3dd4e046510d3ee856861f02337 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
@@ -18,6 +18,7 @@
#import "chrome/browser/ui/cocoa/l10n_util.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
#include "chrome/browser/ui/content_settings/content_setting_media_menu_model.h"
+#import "chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h"
#include "chrome/grit/generated_resources.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "content/public/browser/plugin_service.h"
@@ -204,6 +205,7 @@ class ContentSettingBubbleWebContentsObserverBridge
- (id)initWithModel:(ContentSettingBubbleModel*)settingsBubbleModel
webContents:(content::WebContents*)webContents
parentWindow:(NSWindow*)parentWindow
+ decoration:(ContentSettingDecoration*)decoration
anchoredAt:(NSPoint)anchoredAt;
- (NSString*)getNibPathForModel:(ContentSettingBubbleModel*)model;
- (NSButton*)hyperlinkButtonWithFrame:(NSRect)frame
@@ -229,16 +231,18 @@ class ContentSettingBubbleWebContentsObserverBridge
@implementation ContentSettingBubbleController
+ (ContentSettingBubbleController*)
- showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel
- webContents:(content::WebContents*)webContents
- parentWindow:(NSWindow*)parentWindow
- anchoredAt:(NSPoint)anchor {
+showForModel:(ContentSettingBubbleModel*)contentSettingBubbleModel
+ webContents:(content::WebContents*)webContents
+parentWindow:(NSWindow*)parentWindow
+ decoration:(ContentSettingDecoration*)decoration
+ anchoredAt:(NSPoint)anchor {
// Autoreleases itself on bubble close.
return [[ContentSettingBubbleController alloc]
- initWithModel:contentSettingBubbleModel
- webContents:webContents
- parentWindow:parentWindow
- anchoredAt:anchor];
+ initWithModel:contentSettingBubbleModel
+ webContents:webContents
+ parentWindow:parentWindow
+ decoration:decoration
+ anchoredAt:anchor];
}
struct ContentTypeToNibPath {
@@ -263,6 +267,7 @@ const ContentTypeToNibPath kNibPaths[] = {
- (id)initWithModel:(ContentSettingBubbleModel*)contentSettingBubbleModel
webContents:(content::WebContents*)webContents
parentWindow:(NSWindow*)parentWindow
+ decoration:(ContentSettingDecoration*)decoration
anchoredAt:(NSPoint)anchoredAt {
// This method takes ownership of |contentSettingBubbleModel| in all cases.
std::unique_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel);
@@ -278,6 +283,7 @@ const ContentTypeToNibPath kNibPaths[] = {
parentWindow:parentWindow
anchoredAt:anchoredAt])) {
contentSettingBubbleModel_.reset(model.release());
+ decoration_ = decoration;
[self showWindow:nil];
}
return self;
@@ -877,4 +883,8 @@ const ContentTypeToNibPath kNibPaths[] = {
return &mediaMenus_;
}
+- (LocationBarDecoration*)decorationForBubble {
+ return decoration_;
+}
+
@end // ContentSettingBubbleController

Powered by Google App Engine
This is Rietveld 408576698