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

Side by Side Diff: chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm

Issue 215363003: Make the screenshare notification window 85% opaque. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/screen_capture_notification_ui_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h" 5 #include "chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/gfx/image/image_skia_util_mac.h" 25 #include "ui/gfx/image/image_skia_util_mac.h"
26 #include "ui/gfx/text_elider.h" 26 #include "ui/gfx/text_elider.h"
27 #include "ui/native_theme/native_theme.h" 27 #include "ui/native_theme/native_theme.h"
28 28
29 const CGFloat kMinimumWidth = 460; 29 const CGFloat kMinimumWidth = 460;
30 const CGFloat kMaximumWidth = 1000; 30 const CGFloat kMaximumWidth = 1000;
31 const CGFloat kHorizontalMargin = 10; 31 const CGFloat kHorizontalMargin = 10;
32 const CGFloat kPadding = 5; 32 const CGFloat kPadding = 5;
33 const CGFloat kPaddingLeft = 10; 33 const CGFloat kPaddingLeft = 10;
34 const CGFloat kWindowCornerRadius = 2; 34 const CGFloat kWindowCornerRadius = 2;
35 const CGFloat kWindowAlphaValue = 0.85;
35 36
36 @interface ScreenCaptureNotificationController() 37 @interface ScreenCaptureNotificationController()
37 - (void)hide; 38 - (void)hide;
38 - (void)populateWithText:(const base::string16&)text; 39 - (void)populateWithText:(const base::string16&)text;
39 @end 40 @end
40 41
41 @interface ScreenCaptureNotificationView : NSView 42 @interface ScreenCaptureNotificationView : NSView
42 @end 43 @end
43 44
44 @interface WindowGripView : NSImageView 45 @interface WindowGripView : NSImageView
(...skipping 28 matching lines...) Expand all
73 74
74 @implementation ScreenCaptureNotificationController 75 @implementation ScreenCaptureNotificationController
75 - (id)initWithCallback:(const base::Closure&)stop_callback 76 - (id)initWithCallback:(const base::Closure&)stop_callback
76 text:(const base::string16&)text { 77 text:(const base::string16&)text {
77 base::scoped_nsobject<NSWindow> window( 78 base::scoped_nsobject<NSWindow> window(
78 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater 79 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
79 styleMask:NSBorderlessWindowMask 80 styleMask:NSBorderlessWindowMask
80 backing:NSBackingStoreBuffered 81 backing:NSBackingStoreBuffered
81 defer:NO]); 82 defer:NO]);
82 [window setReleasedWhenClosed:NO]; 83 [window setReleasedWhenClosed:NO];
84 [window setAlphaValue:kWindowAlphaValue];
83 [window setBackgroundColor:[NSColor clearColor]]; 85 [window setBackgroundColor:[NSColor clearColor]];
84 [window setOpaque:NO]; 86 [window setOpaque:NO];
85 [window setHasShadow:YES]; 87 [window setHasShadow:YES];
86 [window setLevel:NSStatusWindowLevel]; 88 [window setLevel:NSStatusWindowLevel];
87 [window setMovableByWindowBackground:YES]; 89 [window setMovableByWindowBackground:YES];
88 [window setDelegate:self]; 90 [window setDelegate:self];
89 91
90 self = [super initWithWindow:window]; 92 self = [super initWithWindow:window];
91 if (self) { 93 if (self) {
92 stop_callback_ = stop_callback; 94 stop_callback_ = stop_callback;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 self = [super 243 self = [super
242 initWithFrame:NSMakeRect(0, 0, gripImage.Width(), gripImage.Height())]; 244 initWithFrame:NSMakeRect(0, 0, gripImage.Width(), gripImage.Height())];
243 [self setImage:gripImage.ToNSImage()]; 245 [self setImage:gripImage.ToNSImage()];
244 return self; 246 return self;
245 } 247 }
246 248
247 - (BOOL)mouseDownCanMoveWindow { 249 - (BOOL)mouseDownCanMoveWindow {
248 return YES; 250 return YES;
249 } 251 }
250 @end 252 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/screen_capture_notification_ui_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698