[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / screen_capture_notification_ui_cocoa.h
blobe096cea8430dd9af47ce7f8cfbc52dc07422ad70
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
3 // found in the LICENSE file.
5 #import <Cocoa/Cocoa.h>
7 #include <string>
9 #include "base/callback.h"
10 #include "base/gtest_prod_util.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "base/strings/string16.h"
13 #include "chrome/browser/ui/screen_capture_notification_ui.h"
15 // Controller for the screen capture notification window which allows the user
16 // to quickly stop screen capturing.
17 @interface ScreenCaptureNotificationController
18 : NSWindowController<NSWindowDelegate> {
19 @private
20 base::Closure stop_callback_;
21 base::scoped_nsobject<NSButton> stopButton_;
22 base::scoped_nsobject<NSButton> minimizeButton_;
25 - (id)initWithCallback:(const base::Closure&)stop_callback
26 text:(const base::string16&)text;
27 - (void)stopSharing:(id)sender;
28 - (void)minimize:(id)sender;
30 @end
32 class ScreenCaptureNotificationUICocoa : public ScreenCaptureNotificationUI {
33 public:
34 explicit ScreenCaptureNotificationUICocoa(const base::string16& text);
35 virtual ~ScreenCaptureNotificationUICocoa();
37 // ScreenCaptureNotificationUI interface.
38 virtual gfx::NativeViewId OnStarted(const base::Closure& stop_callback)
39 OVERRIDE;
41 private:
42 friend class ScreenCaptureNotificationUICocoaTest;
44 const base::string16 text_;
45 base::scoped_nsobject<ScreenCaptureNotificationController> windowController_;
47 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUICocoa);