Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 } | 914 } |
| 915 | 915 |
| 916 void BlinkTestController::OnGetBluetoothManualChooserEvents() { | 916 void BlinkTestController::OnGetBluetoothManualChooserEvents() { |
| 917 if (!bluetooth_chooser_factory_) { | 917 if (!bluetooth_chooser_factory_) { |
| 918 printer_->AddErrorMessage( | 918 printer_->AddErrorMessage( |
| 919 "FAIL: Must call setBluetoothManualChooser before " | 919 "FAIL: Must call setBluetoothManualChooser before " |
| 920 "getBluetoothManualChooserEvents."); | 920 "getBluetoothManualChooserEvents."); |
| 921 return; | 921 return; |
| 922 } | 922 } |
| 923 Send(new ShellViewMsg_ReplyBluetoothManualChooserEvents( | 923 Send(new ShellViewMsg_ReplyBluetoothManualChooserEvents( |
| 924 main_window_->web_contents()->GetRoutingID(), | 924 main_window_->web_contents()->GetRenderViewHost()->GetRoutingID(), |
|
alexmos
2016/11/22 01:29:06
Seems like we get here to send a reply when layout
| |
| 925 bluetooth_chooser_factory_->GetAndResetEvents())); | 925 bluetooth_chooser_factory_->GetAndResetEvents())); |
| 926 } | 926 } |
| 927 | 927 |
| 928 void BlinkTestController::OnSendBluetoothManualChooserEvent( | 928 void BlinkTestController::OnSendBluetoothManualChooserEvent( |
| 929 const std::string& event_name, | 929 const std::string& event_name, |
| 930 const std::string& argument) { | 930 const std::string& argument) { |
| 931 if (!bluetooth_chooser_factory_) { | 931 if (!bluetooth_chooser_factory_) { |
| 932 printer_->AddErrorMessage( | 932 printer_->AddErrorMessage( |
| 933 "FAIL: Must call setBluetoothManualChooser before " | 933 "FAIL: Must call setBluetoothManualChooser before " |
| 934 "sendBluetoothManualChooserEvent."); | 934 "sendBluetoothManualChooserEvent."); |
| 935 return; | 935 return; |
| 936 } | 936 } |
| 937 BluetoothChooser::Event event; | 937 BluetoothChooser::Event event; |
| 938 if (event_name == "cancelled") { | 938 if (event_name == "cancelled") { |
| 939 event = BluetoothChooser::Event::CANCELLED; | 939 event = BluetoothChooser::Event::CANCELLED; |
| 940 } else if (event_name == "selected") { | 940 } else if (event_name == "selected") { |
| 941 event = BluetoothChooser::Event::SELECTED; | 941 event = BluetoothChooser::Event::SELECTED; |
| 942 } else if (event_name == "rescan") { | 942 } else if (event_name == "rescan") { |
| 943 event = BluetoothChooser::Event::RESCAN; | 943 event = BluetoothChooser::Event::RESCAN; |
| 944 } else { | 944 } else { |
| 945 printer_->AddErrorMessage(base::StringPrintf( | 945 printer_->AddErrorMessage(base::StringPrintf( |
| 946 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 946 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
| 947 event_name.c_str())); | 947 event_name.c_str())); |
| 948 return; | 948 return; |
| 949 } | 949 } |
| 950 bluetooth_chooser_factory_->SendEvent(event, argument); | 950 bluetooth_chooser_factory_->SendEvent(event, argument); |
| 951 } | 951 } |
| 952 | 952 |
| 953 } // namespace content | 953 } // namespace content |
| OLD | NEW |