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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 unified diff | Download patch
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 DCHECK(!stop_callback.is_null()); 60 DCHECK(!stop_callback.is_null());
61 DCHECK(!windowController_); 61 DCHECK(!windowController_);
62 62
63 windowController_.reset([[ScreenCaptureNotificationController alloc] 63 windowController_.reset([[ScreenCaptureNotificationController alloc]
64 initWithCallback:stop_callback 64 initWithCallback:stop_callback
65 text:text_]); 65 text:text_]);
66 [windowController_ showWindow:nil]; 66 [windowController_ showWindow:nil];
67 return [[windowController_ window] windowNumber]; 67 return [[windowController_ window] windowNumber];
68 } 68 }
69 69
70 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( 70 std::unique_ptr<ScreenCaptureNotificationUI>
71 const base::string16& text) { 71 ScreenCaptureNotificationUI::Create(const base::string16& text) {
72 return scoped_ptr<ScreenCaptureNotificationUI>( 72 return std::unique_ptr<ScreenCaptureNotificationUI>(
73 new ScreenCaptureNotificationUICocoa(text)); 73 new ScreenCaptureNotificationUICocoa(text));
74 } 74 }
75 75
76 @implementation ScreenCaptureNotificationController 76 @implementation ScreenCaptureNotificationController
77 - (id)initWithCallback:(const base::Closure&)stop_callback 77 - (id)initWithCallback:(const base::Closure&)stop_callback
78 text:(const base::string16&)text { 78 text:(const base::string16&)text {
79 base::scoped_nsobject<NSWindow> window( 79 base::scoped_nsobject<NSWindow> window(
80 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater 80 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
81 styleMask:NSBorderlessWindowMask 81 styleMask:NSBorderlessWindowMask
82 backing:NSBackingStoreBuffered 82 backing:NSBackingStoreBuffered
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 self = [super 255 self = [super
256 initWithFrame:NSMakeRect(0, 0, gripImage.Width(), gripImage.Height())]; 256 initWithFrame:NSMakeRect(0, 0, gripImage.Width(), gripImage.Height())];
257 [self setImage:gripImage.ToNSImage()]; 257 [self setImage:gripImage.ToNSImage()];
258 return self; 258 return self;
259 } 259 }
260 260
261 - (BOOL)mouseDownCanMoveWindow { 261 - (BOOL)mouseDownCanMoveWindow {
262 return YES; 262 return YES;
263 } 263 }
264 @end 264 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/run_loop_testing.mm ('k') | chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698