| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_
H_ | 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_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_
H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "content/public/browser/bluetooth_chooser.h" | 13 #include "content/public/browser/bluetooth_chooser.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class RenderFrameHost; | 17 class RenderFrameHost; |
| 18 | 18 |
| 19 class LayoutTestBluetoothChooserFactory { | 19 class LayoutTestBluetoothChooserFactory { |
| 20 public: | 20 public: |
| 21 LayoutTestBluetoothChooserFactory(); | 21 LayoutTestBluetoothChooserFactory(); |
| 22 ~LayoutTestBluetoothChooserFactory(); | 22 ~LayoutTestBluetoothChooserFactory(); |
| 23 | 23 |
| 24 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( | 24 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( |
| 25 RenderFrameHost* frame, | 25 RenderFrameHost* frame, |
| 26 const BluetoothChooser::EventHandler& event_handler); | 26 const BluetoothChooser::EventHandler& event_handler, |
| 27 bool accept_all_devices); |
| 27 | 28 |
| 28 std::vector<std::string> GetAndResetEvents(); | 29 std::vector<std::string> GetAndResetEvents(); |
| 29 | 30 |
| 30 void SendEvent(BluetoothChooser::Event event, const std::string& device_id); | 31 void SendEvent(BluetoothChooser::Event event, const std::string& device_id); |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 class Chooser; | 34 class Chooser; |
| 34 | 35 |
| 35 std::vector<std::string> events_; | 36 std::vector<std::string> events_; |
| 36 | 37 |
| 37 // Contains the set of live choosers, in order to send them events. | 38 // Contains the set of live choosers, in order to send them events. |
| 38 std::set<Chooser*> choosers_; | 39 std::set<Chooser*> choosers_; |
| 39 | 40 |
| 40 base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_; | 41 base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace content | 44 } // namespace content |
| 44 | 45 |
| 45 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTO
RY_H_ | 46 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTO
RY_H_ |
| OLD | NEW |