| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |