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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1050 const std::string& name, | 1050 const std::string& name, |
1051 const base::Optional<std::vector<uint8_t>>& new_data) { | 1051 const base::Optional<std::vector<uint8_t>>& new_data) { |
1052 Window* window = GetWindowByServerId(window_id); | 1052 Window* window = GetWindowByServerId(window_id); |
1053 if (!window) | 1053 if (!window) |
1054 return; | 1054 return; |
1055 | 1055 |
1056 InFlightPropertyChange new_change(window, name, new_data); | 1056 InFlightPropertyChange new_change(window, name, new_data); |
1057 if (ApplyServerChangeToExistingInFlightChange(new_change)) | 1057 if (ApplyServerChangeToExistingInFlightChange(new_change)) |
1058 return; | 1058 return; |
1059 | 1059 |
1060 WindowPrivate(window).LocalSetSharedProperty(name, new_data); | 1060 WindowPrivate(window).LocalSetSharedProperty(name, |
1061 new_data ? &*new_data : nullptr); | |
yzshen1
2017/01/06 19:38:38
nit: &new_data.value()?
Sam McNally
2017/01/09 23:15:15
Done.
| |
1061 } | 1062 } |
1062 | 1063 |
1063 void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, | 1064 void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
1064 Id window_id, | 1065 Id window_id, |
1065 std::unique_ptr<ui::Event> event, | 1066 std::unique_ptr<ui::Event> event, |
1066 bool matches_pointer_watcher) { | 1067 bool matches_pointer_watcher) { |
1067 DCHECK(event); | 1068 DCHECK(event); |
1068 Window* window = GetWindowByServerId(window_id); // May be null. | 1069 Window* window = GetWindowByServerId(window_id); // May be null. |
1069 | 1070 |
1070 if (matches_pointer_watcher && has_pointer_watcher_) { | 1071 if (matches_pointer_watcher && has_pointer_watcher_) { |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 // TODO(riajiang): Figure out if |offset| needs to be converted. | 1473 // TODO(riajiang): Figure out if |offset| needs to be converted. |
1473 // (http://crbugs.com/646932) | 1474 // (http://crbugs.com/646932) |
1474 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1475 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
1475 server_id(window), offset.x(), offset.y(), | 1476 server_id(window), offset.x(), offset.y(), |
1476 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1477 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
1477 hit_area)); | 1478 hit_area)); |
1478 } | 1479 } |
1479 } | 1480 } |
1480 | 1481 |
1481 } // namespace ui | 1482 } // namespace ui |
OLD | NEW |