OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 const std::string& name, | 1049 const std::string& name, |
1050 const base::Optional<std::vector<uint8_t>>& new_data) { | 1050 const base::Optional<std::vector<uint8_t>>& new_data) { |
1051 Window* window = GetWindowByServerId(window_id); | 1051 Window* window = GetWindowByServerId(window_id); |
1052 if (!window) | 1052 if (!window) |
1053 return; | 1053 return; |
1054 | 1054 |
1055 InFlightPropertyChange new_change(window, name, new_data); | 1055 InFlightPropertyChange new_change(window, name, new_data); |
1056 if (ApplyServerChangeToExistingInFlightChange(new_change)) | 1056 if (ApplyServerChangeToExistingInFlightChange(new_change)) |
1057 return; | 1057 return; |
1058 | 1058 |
1059 WindowPrivate(window).LocalSetSharedProperty(name, new_data); | 1059 WindowPrivate(window).LocalSetSharedProperty( |
| 1060 name, new_data ? &new_data.value() : nullptr); |
1060 } | 1061 } |
1061 | 1062 |
1062 void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, | 1063 void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
1063 Id window_id, | 1064 Id window_id, |
1064 std::unique_ptr<ui::Event> event, | 1065 std::unique_ptr<ui::Event> event, |
1065 bool matches_pointer_watcher) { | 1066 bool matches_pointer_watcher) { |
1066 DCHECK(event); | 1067 DCHECK(event); |
1067 Window* window = GetWindowByServerId(window_id); // May be null. | 1068 Window* window = GetWindowByServerId(window_id); // May be null. |
1068 | 1069 |
1069 if (matches_pointer_watcher && has_pointer_watcher_) { | 1070 if (matches_pointer_watcher && has_pointer_watcher_) { |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 // TODO(riajiang): Figure out if |offset| needs to be converted. | 1472 // TODO(riajiang): Figure out if |offset| needs to be converted. |
1472 // (http://crbugs.com/646932) | 1473 // (http://crbugs.com/646932) |
1473 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1474 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
1474 server_id(window), offset.x(), offset.y(), | 1475 server_id(window), offset.x(), offset.y(), |
1475 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1476 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
1476 hit_area)); | 1477 hit_area)); |
1477 } | 1478 } |
1478 } | 1479 } |
1479 | 1480 |
1480 } // namespace ui | 1481 } // namespace ui |
OLD | NEW |