| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "chrome/browser/ui/screen_capture_notification_ui.h" | 13 #include "chrome/browser/ui/screen_capture_notification_ui.h" |
| 14 | 14 |
| 15 // Controller for the screen capture notification window which allows the user | 15 // Controller for the screen capture notification window which allows the user |
| 16 // to quickly stop screen capturing. | 16 // to quickly stop screen capturing. |
| 17 @interface ScreenCaptureNotificationController | 17 @interface ScreenCaptureNotificationController |
| 18 : NSWindowController<NSWindowDelegate> { | 18 : NSWindowController<NSWindowDelegate> { |
| 19 @private | 19 @private |
| 20 base::Closure stop_callback_; | 20 base::Closure stop_callback_; |
| 21 base::scoped_nsobject<NSButton> stopButton_; | 21 base::scoped_nsobject<NSButton> stopButton_; |
| 22 base::scoped_nsobject<NSButton> minimizeButton_; |
| 22 } | 23 } |
| 23 | 24 |
| 24 - (id)initWithCallback:(const base::Closure&)stop_callback | 25 - (id)initWithCallback:(const base::Closure&)stop_callback |
| 25 text:(const base::string16&)text; | 26 text:(const base::string16&)text; |
| 26 - (void)stopSharing:(id)sender; | 27 - (void)stopSharing:(id)sender; |
| 28 - (void)minimize:(id)sender; |
| 27 | 29 |
| 28 @end | 30 @end |
| 29 | 31 |
| 30 class ScreenCaptureNotificationUICocoa : public ScreenCaptureNotificationUI { | 32 class ScreenCaptureNotificationUICocoa : public ScreenCaptureNotificationUI { |
| 31 public: | 33 public: |
| 32 explicit ScreenCaptureNotificationUICocoa(const base::string16& text); | 34 explicit ScreenCaptureNotificationUICocoa(const base::string16& text); |
| 33 virtual ~ScreenCaptureNotificationUICocoa(); | 35 virtual ~ScreenCaptureNotificationUICocoa(); |
| 34 | 36 |
| 35 // ScreenCaptureNotificationUI interface. | 37 // ScreenCaptureNotificationUI interface. |
| 36 virtual void OnStarted(const base::Closure& stop_callback) OVERRIDE; | 38 virtual void OnStarted(const base::Closure& stop_callback) OVERRIDE; |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 friend class ScreenCaptureNotificationUICocoaTest; | 41 friend class ScreenCaptureNotificationUICocoaTest; |
| 40 | 42 |
| 41 const base::string16 text_; | 43 const base::string16 text_; |
| 42 base::scoped_nsobject<ScreenCaptureNotificationController> windowController_; | 44 base::scoped_nsobject<ScreenCaptureNotificationController> windowController_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUICocoa); | 46 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUICocoa); |
| 45 }; | 47 }; |
| OLD | NEW |