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

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h

Issue 1325953002: Add functions to let tests read and control the Bluetooth chooser state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 5 years, 3 months 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
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_
7
8 #include "content/public/browser/bluetooth_chooser.h"
9
10 #include <set>
11 #include <vector>
12
13 #include "base/memory/weak_ptr.h"
14 #include "content/public/browser/bluetooth_chooser.h"
15
16 class GURL;
17
18 namespace content {
19
20 class WebContents;
21
22 class LayoutTestBluetoothChooserFactory {
23 public:
24 LayoutTestBluetoothChooserFactory();
25 ~LayoutTestBluetoothChooserFactory();
26
27 scoped_ptr<BluetoothChooser> RunBluetoothChooser(
28 WebContents* web_contents,
29 const BluetoothChooser::EventHandler& event_handler,
30 const GURL& origin);
31
32 std::vector<std::string> GetAndResetEvents();
33
34 void SendEvent(BluetoothChooser::Event event, const std::string& device_id);
35
36 private:
37 class Chooser;
38
39 std::vector<std::string> events_;
40
41 // Contains the set of live choosers, in order to send them events.
42 std::set<Chooser*> choosers_;
43
44 base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_;
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTO RY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698