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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static void SetPickerFactoryForTests(PickerFactory* factory); | 42 static void SetPickerFactoryForTests(PickerFactory* factory); |
43 | 43 |
44 DesktopCaptureChooseDesktopMediaFunction(); | 44 DesktopCaptureChooseDesktopMediaFunction(); |
45 | 45 |
46 void Cancel(); | 46 void Cancel(); |
47 | 47 |
48 private: | 48 private: |
49 virtual ~DesktopCaptureChooseDesktopMediaFunction(); | 49 virtual ~DesktopCaptureChooseDesktopMediaFunction(); |
50 | 50 |
51 // ExtensionFunction overrides. | 51 // ExtensionFunction overrides. |
52 virtual bool RunAsync() OVERRIDE; | 52 virtual bool RunAsync() override; |
53 | 53 |
54 // content::WebContentsObserver overrides. | 54 // content::WebContentsObserver overrides. |
55 virtual void WebContentsDestroyed() OVERRIDE; | 55 virtual void WebContentsDestroyed() override; |
56 | 56 |
57 void OnPickerDialogResults(content::DesktopMediaID source); | 57 void OnPickerDialogResults(content::DesktopMediaID source); |
58 | 58 |
59 int request_id_; | 59 int request_id_; |
60 | 60 |
61 // URL of page that desktop capture was requested for. | 61 // URL of page that desktop capture was requested for. |
62 GURL origin_; | 62 GURL origin_; |
63 | 63 |
64 scoped_ptr<DesktopMediaPicker> picker_; | 64 scoped_ptr<DesktopMediaPicker> picker_; |
65 }; | 65 }; |
66 | 66 |
67 class DesktopCaptureCancelChooseDesktopMediaFunction | 67 class DesktopCaptureCancelChooseDesktopMediaFunction |
68 : public ChromeSyncExtensionFunction { | 68 : public ChromeSyncExtensionFunction { |
69 public: | 69 public: |
70 DECLARE_EXTENSION_FUNCTION("desktopCapture.cancelChooseDesktopMedia", | 70 DECLARE_EXTENSION_FUNCTION("desktopCapture.cancelChooseDesktopMedia", |
71 DESKTOPCAPTURE_CANCELCHOOSEDESKTOPMEDIA) | 71 DESKTOPCAPTURE_CANCELCHOOSEDESKTOPMEDIA) |
72 | 72 |
73 DesktopCaptureCancelChooseDesktopMediaFunction(); | 73 DesktopCaptureCancelChooseDesktopMediaFunction(); |
74 | 74 |
75 private: | 75 private: |
76 virtual ~DesktopCaptureCancelChooseDesktopMediaFunction(); | 76 virtual ~DesktopCaptureCancelChooseDesktopMediaFunction(); |
77 | 77 |
78 // ExtensionFunction overrides. | 78 // ExtensionFunction overrides. |
79 virtual bool RunSync() OVERRIDE; | 79 virtual bool RunSync() override; |
80 }; | 80 }; |
81 | 81 |
82 class DesktopCaptureRequestsRegistry { | 82 class DesktopCaptureRequestsRegistry { |
83 public: | 83 public: |
84 DesktopCaptureRequestsRegistry(); | 84 DesktopCaptureRequestsRegistry(); |
85 ~DesktopCaptureRequestsRegistry(); | 85 ~DesktopCaptureRequestsRegistry(); |
86 | 86 |
87 static DesktopCaptureRequestsRegistry* GetInstance(); | 87 static DesktopCaptureRequestsRegistry* GetInstance(); |
88 | 88 |
89 void AddRequest(int process_id, | 89 void AddRequest(int process_id, |
(...skipping 19 matching lines...) Expand all Loading... |
109 DesktopCaptureChooseDesktopMediaFunction*> RequestsMap; | 109 DesktopCaptureChooseDesktopMediaFunction*> RequestsMap; |
110 | 110 |
111 RequestsMap requests_; | 111 RequestsMap requests_; |
112 | 112 |
113 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureRequestsRegistry); | 113 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureRequestsRegistry); |
114 }; | 114 }; |
115 | 115 |
116 } // namespace extensions | 116 } // namespace extensions |
117 | 117 |
118 #endif // CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ |
OLD | NEW |