| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chooser_controller/mock_chooser_controller.h" | 5 #include "chrome/browser/chooser_controller/mock_chooser_controller.h" |
| 6 #include "chrome/grit/generated_resources.h" |
| 6 | 7 |
| 7 MockChooserController::MockChooserController(content::RenderFrameHost* owner) | 8 MockChooserController::MockChooserController(content::RenderFrameHost* owner) |
| 8 : ChooserController(owner) {} | 9 : ChooserController(owner, |
| 10 IDS_USB_DEVICE_CHOOSER_PROMPT_ORIGIN, |
| 11 IDS_USB_DEVICE_CHOOSER_PROMPT_EXTENSION_NAME) {} |
| 9 | 12 |
| 10 MockChooserController::~MockChooserController() {} | 13 MockChooserController::~MockChooserController() {} |
| 11 | 14 |
| 12 base::string16 MockChooserController::GetOkButtonLabel() const { | 15 base::string16 MockChooserController::GetOkButtonLabel() const { |
| 13 return base::string16(); | 16 return base::string16(); |
| 14 } | 17 } |
| 15 | 18 |
| 16 size_t MockChooserController::NumOptions() const { | 19 size_t MockChooserController::NumOptions() const { |
| 17 return option_names_.size(); | 20 return option_names_.size(); |
| 18 } | 21 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 for (auto it = option_names_.begin(); it != option_names_.end(); ++it) { | 34 for (auto it = option_names_.begin(); it != option_names_.end(); ++it) { |
| 32 if (*it == option_name) { | 35 if (*it == option_name) { |
| 33 size_t index = it - option_names_.begin(); | 36 size_t index = it - option_names_.begin(); |
| 34 option_names_.erase(it); | 37 option_names_.erase(it); |
| 35 if (observer()) | 38 if (observer()) |
| 36 observer()->OnOptionRemoved(index); | 39 observer()->OnOptionRemoved(index); |
| 37 return; | 40 return; |
| 38 } | 41 } |
| 39 } | 42 } |
| 40 } | 43 } |
| OLD | NEW |