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

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm

Issue 1086973004: [Extensions Mac] Implement developer mode warning on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 8 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/extensions/browser_actions_container_view.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm
index ecd68752398300c86fdc5f14fdc5650bf067c349..d718eec153dc75ff690b75632600604f5e46e7bf 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm
@@ -8,6 +8,8 @@
#include "base/basictypes.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
+#include "grit/theme_resources.h"
+#include "ui/base/cocoa/appkit_utils.h"
NSString* const kBrowserActionGrippyDragStartedNotification =
@"BrowserActionGrippyDragStartedNotification";
@@ -71,6 +73,15 @@ const CGFloat kMinimumContainerWidth = 3.0;
[super dealloc];
}
+- (void)drawRect:(NSRect)rect {
+ [super drawRect:rect];
+ if (isHighlighting_) {
+ ui::NinePartImageIds imageIds = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT);
Devlin 2015/04/16 16:02:38 Avi, is this there a better way of doing this?
Avi (use Gerrit) 2015/04/16 19:05:54 That seems to be how it's done elsewhere.
Devlin 2015/04/16 22:40:59 It's a shame we have to draw the whole background
+ ui::DrawNinePartImage(
+ [self bounds], imageIds, NSCompositeSourceOver, 1.0, true);
+ }
+}
+
- (void)setTrackingEnabled:(BOOL)enabled {
if (enabled) {
trackingArea_.reset(
@@ -88,6 +99,13 @@ const CGFloat kMinimumContainerWidth = 3.0;
}
}
+- (void)setIsHighlighting:(BOOL)isHighlighting {
+ if (isHighlighting != isHighlighting_) {
+ isHighlighting_ = isHighlighting;
+ [self setNeedsDisplay:YES];
+ }
+}
+
- (void)setResizable:(BOOL)resizable {
if (resizable == resizable_)
return;

Powered by Google App Engine
This is Rietveld 408576698