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 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor
y.h" | 5 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor
y.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
8 #include "url/gurl.h" | 9 #include "url/gurl.h" |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 class WebContents; | 13 class WebContents; |
13 | 14 |
14 // Implements a Bluetooth chooser that records events it's sent, instead of | 15 // Implements a Bluetooth chooser that records events it's sent, instead of |
15 // showing a dialog. It allows tests to control how the chooser responds. | 16 // showing a dialog. It allows tests to control how the chooser responds. |
16 class LayoutTestBluetoothChooserFactory::Chooser : public BluetoothChooser { | 17 class LayoutTestBluetoothChooserFactory::Chooser : public BluetoothChooser { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const std::string& device_id) { | 122 const std::string& device_id) { |
122 // Copy |choosers_| to make sure event handler executions that modify | 123 // Copy |choosers_| to make sure event handler executions that modify |
123 // |choosers_| don't invalidate iterators. | 124 // |choosers_| don't invalidate iterators. |
124 std::vector<Chooser*> choosers_copy(choosers_.begin(), choosers_.end()); | 125 std::vector<Chooser*> choosers_copy(choosers_.begin(), choosers_.end()); |
125 for (Chooser* chooser : choosers_copy) { | 126 for (Chooser* chooser : choosers_copy) { |
126 chooser->event_handler.Run(event, device_id); | 127 chooser->event_handler.Run(event, device_id); |
127 } | 128 } |
128 } | 129 } |
129 | 130 |
130 } // namespace content | 131 } // namespace content |
OLD | NEW |