Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from chromium:main #124

Merged
merged 48 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2071b03
Reland "input: Add keyboard details, top row, to input diagnostics"
kenalba-google Dec 16, 2021
2458385
Reporting: pass metric data to healthd sampler.
Dec 16, 2021
8761c37
Let AutocompleteEditTextTest know about a bug in EditText
yukawa Dec 16, 2021
07b8e35
[GTK] Update frame decorations for GTK4
tanderson-google Dec 16, 2021
ec3f329
[Sheriff] Disable DevToolsProtocolTest.NavigationPreservesMessages
Celsius273 Dec 16, 2021
da37557
[Dr-Dc] Thread safe vulkan Queue.
vikaschromie Dec 16, 2021
697781d
[fuchsia] Add Flatland to Fuchsia watchlist
ddorwin Dec 16, 2021
4018b78
[Fast Pair Device Images] Add DeviceImageInfo to Bluetooth Config
Dec 16, 2021
df8b3f4
[DesktopSharingHub] Add "Sending..." toast to sharing hub icon
Dec 16, 2021
1caf15c
overflow-clip-margin: Make sure we can inherit from any parent.
vmpstr Dec 16, 2021
8d10a30
Use abstract interfaces in CORB unit tests.
anforowicz Dec 16, 2021
dceed1d
media/gpu/v4l2: add MEDIA_REQUEST_IOC_REINIT ioctl call
Dec 16, 2021
b9f11fa
Roll Skia from 3f95fd2ed8c4 to 44a839262076 (7 revisions)
Dec 16, 2021
04f78ec
[Sheriff] Disable BackForwardCacheBrowserTest.ShortVibrationSequenceS…
rogerm Dec 16, 2021
d54567e
Remove unused directories from distributed_point_functions library
alexmturner Dec 16, 2021
46a3e15
Remove report from SentReport and rename to SendResult
linnan-github Dec 16, 2021
0df9f07
Roll WebRTC from 03cb7e5a6124 to 977234879de7 (1 revision)
Dec 16, 2021
8a2b79b
Roll Perfetto from 9c674c8ed684 to cefb3e0ec3a0 (1 revision)
Dec 16, 2021
ede4193
[GridFragmentation] Fix crash with indefinite forced breaks.
bfgeek Dec 16, 2021
931613b
Roll Catapult from 2c2d76537b02 to d6ef4a8af654 (2 revisions)
Dec 16, 2021
725df73
[block-in-inline] Rebaseline LayoutInlineTest.AbsoluteBoundingBoxRect…
kojiishi Dec 16, 2021
f47b937
Media Foundation Frame Server Mode Part 3: Media Foundation Texture Pool
DavidS-msft Dec 16, 2021
b5658d0
PWA: move permission_item and its dependencies to cr_components
philloooo Dec 16, 2021
1761499
[ios] Remove unused dispatcher from ContentSuggestionsCollectionUpdater
Dec 16, 2021
bdc9d0b
Import wpt@3032c232153b9217bc9ef20a22a2938188dd16e6
Dec 16, 2021
a38cc53
[fuchsia] Strip trailing newline before logging to Fuchsia syslog
Dec 16, 2021
685048e
Implement custom model retention.
Dec 16, 2021
9e0a66a
Remove VLOGs for fetch keepalive + shutdown
yutakahirano Dec 16, 2021
d938432
Roll libunwind from d81cd6236cd7 to 4ead61094cab (1 revision)
Dec 16, 2021
ff54bae
Prevent URL spoofing via CDP.
danilsomsikov Dec 16, 2021
ff5c686
[Android] Open safe values file in background thread
Dec 16, 2021
fca9563
[CrOS Bluetooth] Add bluetooth pairing metrics
Dec 16, 2021
ee7a510
Adding browser test to test various OpenUrl cases in Ash
Dec 16, 2021
8c9f6cb
V8 Sandbox renaming
Dec 16, 2021
f3fca6a
[WebChannels] Introduce FollowingUtil class
Dec 16, 2021
66eb1b6
Add accessible names to the tab strip scroll buttons.
Dec 16, 2021
d7c3d14
Roll src-internal from 3f843f82c4b6 to 6b2cb689b53f (5 revisions)
Dec 16, 2021
f0bab1c
Speculative workaround to NSUserDefaults crash on write.
Dec 16, 2021
2a17104
[LR] Add the tears of joy reaction
guillaumejenkins Dec 16, 2021
53811b5
Deflake VerifyHomeLauncherAnimationMetrics test
Dec 16, 2021
cde4be4
Record UKM for share clicks on mobile
ssiddhartha Dec 16, 2021
eea7449
Shimless: Add retry provisioning button
Dec 16, 2021
2ff27e5
Add LacrosPrefStore for lacros settings
Dec 16, 2021
971c246
webcodecs: Groundwork for software AV1 encoder based on libaom
Djuffin Dec 16, 2021
d52e235
bluetooth: Fix the test that returns before the test promise resolved
chengweih001 Dec 16, 2021
8ec80b8
Roll ChromeOS Orderfiles from 98-4744.1-1639393599-benchmark-98.0.475…
Dec 16, 2021
666c69c
Add synchronous call for segment selector
Dec 16, 2021
32de615
WebUI: Migrate shared custom_element.js to TypeScript.
freshp86 Dec 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling Skia
# and whatever else without interference from each other.
'skia_revision': '3f95fd2ed8c4d12315a2f73484e297f69aa37d2e',
'skia_revision': '44a83926207668ad8de5eae74d68a54812ca55ad',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling V8
# and whatever else without interference from each other.
Expand Down Expand Up @@ -312,7 +312,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling catapult
# and whatever else without interference from each other.
'catapult_revision': '2c2d76537b02cca4c0df364f14ee6e9b28afaf8b',
'catapult_revision': 'd6ef4a8af654ca24f8adca2a892f6f7857d57d2f',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libFuzzer
# and whatever else without interference from each other.
Expand Down Expand Up @@ -408,7 +408,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.
'libunwind_revision': 'd81cd6236cd771e78d7e1a1807404ef3f1d21820',
'libunwind_revision': '4ead61094cab5ac7a90198fbe182596c4775183e',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.
Expand Down Expand Up @@ -1427,7 +1427,7 @@ deps = {
},

'src/third_party/perfetto':
Var('android_git') + '/platform/external/perfetto.git' + '@' + '9c674c8ed6844fb88b545a8df9282a9405f8a072',
Var('android_git') + '/platform/external/perfetto.git' + '@' + 'cefb3e0ec3a0580c996f801e854fe02963c03d5c',

'src/third_party/perl': {
'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3',
Expand Down Expand Up @@ -1648,7 +1648,7 @@ deps = {
Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'c843f8d63c8c17acfbb7d48e09059a581ba779b9',

'src/third_party/webrtc':
Var('webrtc_git') + '/src.git' + '@' + '03cb7e5a6124d7475bba4da6e5f093f1c0306c9e',
Var('webrtc_git') + '/src.git' + '@' + '977234879de72cb9df9b191adc9c7520c5c51c35',

'src/third_party/libgifcodec':
Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'),
Expand Down Expand Up @@ -1730,7 +1730,7 @@ deps = {
Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),

'src-internal': {
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@3f843f82c4b67159e309b74ba45690d27f3eac5c',
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@6b2cb689b53fd43f282594b87295a1ebcf675b0b',
'condition': 'checkout_src_internal',
},

Expand Down
14 changes: 8 additions & 6 deletions WATCHLISTS
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,9 @@
'ui/gl/gl_.*egl.*|'\
'ui/gl/gl_.*ozone.*'
},
'ozone_scenic': {
'filepath': 'ui/ozone/platform/scenic',
'ozone_fuchsia': {
'filepath': 'ui/ozone/platform/flatland/|'\
'ui/ozone/platform/scenic/'
},
'page_info' : {
'filepath': 'chrome/browser/ui/page_info/'\
Expand Down Expand Up @@ -2670,10 +2671,11 @@
'origin_trials': ['chasej+watch@chromium.org',
'iclelland+watch@chromium.org'],
'ozone': ['ozone-reviews@chromium.org'],
'ozone_scenic': ['dworsham@google.com',
'fuchsia-reviews@chromium.org',
'rjkroege@chromium.org',
'spang+watch@chromium.org'],
'ozone_fuchsia': ['dworsham@google.com',
'emircan@google.com',
'fuchsia-reviews@chromium.org',
'rjkroege@chromium.org',
'spang+watch@chromium.org'],
'page_info' : ['permissions-reviews@chromium.org',
'olesiamarukhno+watch@google.com'],
'page_load_metrics' : ['bmcquade+watch@chromium.org',
Expand Down
1 change: 1 addition & 0 deletions ash/policy/policy_recommendation_restorer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PolicyRecommendationRestorerTest : public NoSessionAshTestBase {
/*managed_prefs=*/new TestingPrefStore,
/*supervised_user_prefs=*/new TestingPrefStore,
/*extension_prefs=*/new TestingPrefStore,
/*standalone_browser_prefs=*/new TestingPrefStore,
/*user_prefs=*/new TestingPrefStore,
recommended_prefs_,
new user_prefs::PrefRegistrySyncable,
Expand Down
25 changes: 13 additions & 12 deletions ash/shelf/drag_window_from_shelf_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "ui/aura/client/window_parenting_client.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/test/test_utils.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/core/transient_window_manager.h"
Expand Down Expand Up @@ -107,17 +108,17 @@ class DragWindowFromShelfControllerTest : public AshTestBase {
void CancelDrag() { window_drag_controller_->CancelDrag(); }
void WaitForHomeLauncherAnimationToFinish() {
// Wait until home launcher animation finishes.
while (GetAppListTestHelper()
->GetAppListView()
->GetWidget()
->GetLayer()
->GetAnimator()
->is_animating()) {
base::RunLoop run_loop;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(), base::Milliseconds(200));
run_loop.Run();
}
ui::Layer* layer =
GetAppListTestHelper()->GetAppListView()->GetWidget()->GetLayer();
ui::Compositor* compositor = layer->GetCompositor();

while (layer->GetAnimator()->is_animating())
EXPECT_TRUE(ui::WaitForNextFrameToBePresented(compositor));

// Ensure there is one more frame presented after animation finishes
// to allow animation throughput data is passed from cc to ui.
ignore_result(
ui::WaitForNextFrameToBePresented(compositor, base::Milliseconds(200)));
}

SplitViewController* split_view_controller() {
Expand Down Expand Up @@ -1393,4 +1394,4 @@ TEST_F(DragWindowFromShelfControllerTest,
EXPECT_FALSE(transient_child_win1->IsVisible());
EXPECT_FALSE(transient_child_win2->IsVisible());
}
} // namespace ash
} // namespace ash
1 change: 1 addition & 0 deletions ash/system/power/power_prefs_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class PowerPrefsTest : public NoSessionAshTestBase {
auto pref_value_store = std::make_unique<PrefValueStore>(
managed_pref_store_.get() /* managed_prefs */,
nullptr /* supervised_user_prefs */, nullptr /* extension_prefs */,
nullptr /* standalone_browser_prefs */,
nullptr /* command_line_prefs */, user_pref_store_.get(),
nullptr /* recommended_prefs */, pref_registry_->defaults().get(),
pref_notifier.get());
Expand Down
5 changes: 5 additions & 0 deletions ash/webui/diagnostics_ui/backend/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static_library("backend") {
]

deps = [
"//ash",
"//ash/constants:constants",
"//ash/public/cpp",
"//ash/webui/diagnostics_ui/mojom",
Expand All @@ -65,6 +66,8 @@ static_library("backend") {
"//services/device/public/mojom",
"//ui/base",
"//ui/base/ime/ash",
"//ui/chromeos/events",
"//ui/events/devices",
"//ui/events/ozone",
"//ui/events/ozone/evdev:event_device_info",
"//ui/events/ozone/layout",
Expand Down Expand Up @@ -118,9 +121,11 @@ source_set("unit_tests") {
"//components/sync_preferences:test_support",
"//content/test:test_support",
"//dbus",
"//device/udev_linux:test_support",
"//services/data_decoder/public/cpp:test_support",
"//services/device/public/cpp:test_support",
"//testing/gtest",
"//ui/chromeos/events",
"//ui/events/ozone",
"//ui/events/ozone/evdev:event_device_info_test_utils",
"//ui/gfx",
Expand Down
5 changes: 5 additions & 0 deletions ash/webui/diagnostics_ui/backend/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
specific_include_rules = {
"input_data_provider_unittest\.cc": [
"+device/udev_linux/fake_udev_loader.h",
]
}
109 changes: 71 additions & 38 deletions ash/webui/diagnostics_ui/backend/input_data_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "base/strings/string_util.h"
#include "chromeos/system/statistics_provider.h"
#include "ui/base/ime/ash/input_method_manager.h"
#include "ui/events/devices/device_util_linux.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/ozone/evdev/event_device_info.h"
Expand All @@ -33,40 +35,54 @@ bool GetEventNodeId(base::FilePath path, int* id) {
const std::string base_name_prefix = "event";

std::string base_name = path.BaseName().value();
DCHECK(base::StartsWith(base_name, base_name_prefix));
if (!base::StartsWith(base_name, base_name_prefix))
return false;
base_name.erase(0, base_name_prefix.length());
return base::StringToInt(base_name, id);
}

mojom::ConnectionType ConnectionTypeFromInputDeviceType(
ui::InputDeviceType type) {
switch (type) {
case ui::InputDeviceType::INPUT_DEVICE_INTERNAL:
return mojom::ConnectionType::kInternal;
case ui::InputDeviceType::INPUT_DEVICE_USB:
return mojom::ConnectionType::kUsb;
case ui::InputDeviceType::INPUT_DEVICE_BLUETOOTH:
return mojom::ConnectionType::kBluetooth;
case ui::InputDeviceType::INPUT_DEVICE_UNKNOWN:
return mojom::ConnectionType::kUnknown;
}
// Determine if this particular evdev provides touchpad or touchscreen input;
// we do not want stylus devices, which also claim to be touchscreens.
bool IsTouchInputDevice(InputDeviceInformation* device_info) {
return (device_info->event_device_info.HasTouchpad() ||
(device_info->event_device_info.HasTouchscreen() &&
!device_info->event_device_info.HasStylus()));
}

} // namespace

std::unique_ptr<ui::EventDeviceInfo> InputDeviceInfoHelper::GetDeviceInfo(
// All blockings calls for identifying hardware need to go here: both
// EventDeviceInfo::Initialize and ui::GetInputPathInSys can block in
// base::MakeAbsoluteFilePath.
std::unique_ptr<InputDeviceInformation> InputDeviceInfoHelper::GetDeviceInfo(
int id,
base::FilePath path) {
base::ScopedFD fd(open(path.value().c_str(), O_RDWR | O_NONBLOCK));
if (fd.get() < 0) {
LOG(ERROR) << "Couldn't open device path " << path;
return nullptr;
}

auto device_info = std::make_unique<ui::EventDeviceInfo>();
if (!device_info->Initialize(fd.get(), path)) {
auto info = std::make_unique<InputDeviceInformation>();

if (!info->event_device_info.Initialize(fd.get(), path)) {
LOG(ERROR) << "Failed to get device info for " << path;
return nullptr;
}
return device_info;

const base::FilePath sys_path = ui::GetInputPathInSys(path);

info->path = path;
info->evdev_id = id;
info->connection_type = InputDataProvider::ConnectionTypeFromInputDeviceType(
info->event_device_info.device_type());
info->input_device = ui::InputDevice(
id, info->event_device_info.device_type(), info->event_device_info.name(),
info->event_device_info.phys(), sys_path,
info->event_device_info.vendor_id(), info->event_device_info.product_id(),
info->event_device_info.version());

return info;
}

InputDataProvider::InputDataProvider()
Expand All @@ -84,6 +100,21 @@ InputDataProvider::~InputDataProvider() {
device_manager_->RemoveObserver(this);
}

// static
mojom::ConnectionType InputDataProvider::ConnectionTypeFromInputDeviceType(
ui::InputDeviceType type) {
switch (type) {
case ui::InputDeviceType::INPUT_DEVICE_INTERNAL:
return mojom::ConnectionType::kInternal;
case ui::InputDeviceType::INPUT_DEVICE_USB:
return mojom::ConnectionType::kUsb;
case ui::InputDeviceType::INPUT_DEVICE_BLUETOOTH:
return mojom::ConnectionType::kBluetooth;
case ui::InputDeviceType::INPUT_DEVICE_UNKNOWN:
return mojom::ConnectionType::kUnknown;
}
}

void InputDataProvider::Initialize() {
device_manager_->AddObserver(this);
device_manager_->ScanDevices(this);
Expand All @@ -104,6 +135,7 @@ bool InputDataProvider::ReceiverIsBound() {
void InputDataProvider::OnBoundInterfaceDisconnect() {
receiver_.reset();
}

void InputDataProvider::GetConnectedDevices(
GetConnectedDevicesCallback callback) {
std::vector<mojom::KeyboardInfoPtr> keyboard_vector;
Expand Down Expand Up @@ -158,10 +190,12 @@ void InputDataProvider::OnDeviceEvent(const ui::DeviceEvent& event) {

if (event.action_type() == ui::DeviceEvent::ActionType::ADD) {
info_helper_.AsyncCall(&InputDeviceInfoHelper::GetDeviceInfo)
.WithArgs(event.path())
.WithArgs(id, event.path())
.Then(base::BindOnce(&InputDataProvider::ProcessDeviceInfo,
weak_factory_.GetWeakPtr(), id));
weak_factory_.GetWeakPtr()));

} else {
DCHECK(event.action_type() == ui::DeviceEvent::ActionType::REMOVE);
if (keyboards_.contains(id)) {
keyboards_.erase(id);
for (auto& observer : connected_devices_observers_) {
Expand All @@ -176,40 +210,39 @@ void InputDataProvider::OnDeviceEvent(const ui::DeviceEvent& event) {
}
}

InputDeviceInformation::InputDeviceInformation() = default;
InputDeviceInformation::~InputDeviceInformation() = default;

void InputDataProvider::ProcessDeviceInfo(
int id,
std::unique_ptr<ui::EventDeviceInfo> device_info) {
std::unique_ptr<InputDeviceInformation> device_info) {
if (device_info == nullptr) {
return;
}

if (device_info->HasTouchpad() ||
(device_info->HasTouchscreen() && !device_info->HasStylus())) {
AddTouchDevice(id, device_info.get());
} else if (device_info->HasKeyboard()) {
AddKeyboard(id, device_info.get());
if (IsTouchInputDevice(device_info.get())) {
AddTouchDevice(device_info.get());
} else if (device_info->event_device_info.HasKeyboard()) {
AddKeyboard(device_info.get());
}
}

void InputDataProvider::AddTouchDevice(int id,
const ui::EventDeviceInfo* device_info) {
touch_devices_[id] = touch_helper_.ConstructTouchDevice(
id, device_info,
ConnectionTypeFromInputDeviceType(device_info->device_type()));
void InputDataProvider::AddTouchDevice(
const InputDeviceInformation* device_info) {
touch_devices_[device_info->evdev_id] =
touch_helper_.ConstructTouchDevice(device_info);

for (auto& observer : connected_devices_observers_) {
observer->OnTouchDeviceConnected(touch_devices_[id]->Clone());
observer->OnTouchDeviceConnected(
touch_devices_[device_info->evdev_id]->Clone());
}
}

void InputDataProvider::AddKeyboard(int id,
const ui::EventDeviceInfo* device_info) {
keyboards_[id] = keyboard_helper_.ConstructKeyboard(
id, device_info,
ConnectionTypeFromInputDeviceType(device_info->device_type()));
void InputDataProvider::AddKeyboard(const InputDeviceInformation* device_info) {
keyboards_[device_info->evdev_id] =
keyboard_helper_.ConstructKeyboard(device_info);

for (auto& observer : connected_devices_observers_) {
observer->OnKeyboardConnected(keyboards_[id]->Clone());
observer->OnKeyboardConnected(keyboards_[device_info->evdev_id]->Clone());
}
}

Expand Down
Loading