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