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 "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h" | 5 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" | 8 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" |
9 #include "components/bubble/bubble_controller.h" | 9 #include "components/bubble/bubble_controller.h" |
10 | 10 |
11 BluetoothChooserBubbleDelegate::BluetoothChooserBubbleDelegate(Browser* browser) | 11 BluetoothChooserBubbleDelegate::BluetoothChooserBubbleDelegate( |
12 : ChooserBubbleDelegate(browser), bluetooth_chooser_(nullptr) {} | 12 content::RenderFrameHost* owner) |
| 13 : ChooserBubbleDelegate(owner), bluetooth_chooser_(nullptr) {} |
13 | 14 |
14 BluetoothChooserBubbleDelegate::~BluetoothChooserBubbleDelegate() { | 15 BluetoothChooserBubbleDelegate::~BluetoothChooserBubbleDelegate() { |
15 if (bluetooth_chooser_) | 16 if (bluetooth_chooser_) |
16 bluetooth_chooser_->set_bluetooth_chooser_bubble_delegate(nullptr); | 17 bluetooth_chooser_->set_bluetooth_chooser_bubble_delegate(nullptr); |
17 } | 18 } |
18 | 19 |
19 size_t BluetoothChooserBubbleDelegate::NumOptions() const { | 20 size_t BluetoothChooserBubbleDelegate::NumOptions() const { |
20 return device_names_and_ids_.size(); | 21 return device_names_and_ids_.size(); |
21 } | 22 } |
22 | 23 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 it != device_names_and_ids_.end(); ++it) { | 70 it != device_names_and_ids_.end(); ++it) { |
70 if (it->second == device_id) { | 71 if (it->second == device_id) { |
71 size_t index = it - device_names_and_ids_.begin(); | 72 size_t index = it - device_names_and_ids_.begin(); |
72 device_names_and_ids_.erase(it); | 73 device_names_and_ids_.erase(it); |
73 if (observer()) | 74 if (observer()) |
74 observer()->OnOptionRemoved(index); | 75 observer()->OnOptionRemoved(index); |
75 return; | 76 return; |
76 } | 77 } |
77 } | 78 } |
78 } | 79 } |
OLD | NEW |