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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h

Issue 100303004: Use FakeDesktopMediaList for Desktop Capture API tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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"
11 #include "chrome/browser/extensions/chrome_extension_function.h" 11 #include "chrome/browser/extensions/chrome_extension_function.h"
12 #include "chrome/browser/media/desktop_media_list.h" 12 #include "chrome/browser/media/desktop_media_list.h"
13 #include "chrome/browser/media/desktop_media_picker.h" 13 #include "chrome/browser/media/desktop_media_picker.h"
14 #include "chrome/browser/media/native_desktop_media_list.h" 14 #include "chrome/browser/media/native_desktop_media_list.h"
15 #include "chrome/common/extensions/api/desktop_capture.h" 15 #include "chrome/common/extensions/api/desktop_capture.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 namespace extensions { 18 namespace extensions {
19 19
20 class DesktopCaptureChooseDesktopMediaFunction 20 class DesktopCaptureChooseDesktopMediaFunction
21 : public ChromeAsyncExtensionFunction { 21 : public ChromeAsyncExtensionFunction {
22 public: 22 public:
23 DECLARE_EXTENSION_FUNCTION("desktopCapture.chooseDesktopMedia", 23 DECLARE_EXTENSION_FUNCTION("desktopCapture.chooseDesktopMedia",
24 DESKTOPCAPTURE_CHOOSEDESKTOPMEDIA) 24 DESKTOPCAPTURE_CHOOSEDESKTOPMEDIA)
25 25
26 // Factory creating DesktopMediaList and DesktopMediaPicker instances. 26 // Factory creating DesktopMediaList and DesktopMediaPicker instances.
27 // Used for tests to supply fake picker. 27 // Used for tests to supply fake picker.
28 class PickerFactory { 28 class PickerFactory {
29 public: 29 public:
30 virtual scoped_ptr<DesktopMediaList> CreateModel( 30 virtual scoped_ptr<DesktopMediaList> CreateModel(bool show_screens,
31 scoped_ptr<webrtc::ScreenCapturer> screen_capturer, 31 bool show_windows) = 0;
32 scoped_ptr<webrtc::WindowCapturer> window_capturer) = 0;
33 virtual scoped_ptr<DesktopMediaPicker> CreatePicker() = 0; 32 virtual scoped_ptr<DesktopMediaPicker> CreatePicker() = 0;
34 protected: 33 protected:
35 virtual ~PickerFactory() {} 34 virtual ~PickerFactory() {}
36 }; 35 };
37 36
38 // Used to set PickerFactory used to create mock DesktopMediaPicker instances 37 // Used to set PickerFactory used to create mock DesktopMediaPicker instances
39 // for tests. Calling tests keep ownership of the factory. Can be called with 38 // for tests. Calling tests keep ownership of the factory. Can be called with
40 // |factory| set to NULL at the end of the test. 39 // |factory| set to NULL at the end of the test.
41 static void SetPickerFactoryForTests(PickerFactory* factory); 40 static void SetPickerFactoryForTests(PickerFactory* factory);
42 41
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 DesktopCaptureChooseDesktopMediaFunction*> RequestsMap; 106 DesktopCaptureChooseDesktopMediaFunction*> RequestsMap;
108 107
109 RequestsMap requests_; 108 RequestsMap requests_;
110 109
111 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureRequestsRegistry); 110 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureRequestsRegistry);
112 }; 111 };
113 112
114 } // namespace extensions 113 } // namespace extensions
115 114
116 #endif // CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_ 115 #endif // CHROME_BROWSER_EXTENSIONS_API_DESKTOP_CAPTURE_DESKTOP_CAPTURE_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698