| 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 "ui/aura/mus/window_port_mus.h" | 5 #include "ui/aura/mus/window_port_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/transient_window_client.h" | 9 #include "ui/aura/client/transient_window_client.h" |
| 10 #include "ui/aura/mus/client_surface_embedder.h" | 10 #include "ui/aura/mus/client_surface_embedder.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void WindowPortMus::SetTextInputState(mojo::TextInputStatePtr state) { | 52 void WindowPortMus::SetTextInputState(mojo::TextInputStatePtr state) { |
| 53 window_tree_client_->SetWindowTextInputState(this, std::move(state)); | 53 window_tree_client_->SetWindowTextInputState(this, std::move(state)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void WindowPortMus::SetImeVisibility(bool visible, | 56 void WindowPortMus::SetImeVisibility(bool visible, |
| 57 mojo::TextInputStatePtr state) { | 57 mojo::TextInputStatePtr state) { |
| 58 window_tree_client_->SetImeVisibility(this, visible, std::move(state)); | 58 window_tree_client_->SetImeVisibility(this, visible, std::move(state)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void WindowPortMus::SetPredefinedCursor(ui::mojom::Cursor cursor_id) { | 61 void WindowPortMus::SetPredefinedCursor(ui::mojom::CursorType cursor_id) { |
| 62 if (cursor_id == predefined_cursor_) | 62 if (cursor_id == predefined_cursor_) |
| 63 return; | 63 return; |
| 64 | 64 |
| 65 window_tree_client_->SetPredefinedCursor(this, predefined_cursor_, cursor_id); | 65 window_tree_client_->SetPredefinedCursor(this, predefined_cursor_, cursor_id); |
| 66 predefined_cursor_ = cursor_id; | 66 predefined_cursor_ = cursor_id; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WindowPortMus::SetEventTargetingPolicy( | 69 void WindowPortMus::SetEventTargetingPolicy( |
| 70 ui::mojom::EventTargetingPolicy policy) { | 70 ui::mojom::EventTargetingPolicy policy) { |
| 71 window_tree_client_->SetEventTargetingPolicy(this, policy); | 71 window_tree_client_->SetEventTargetingPolicy(this, policy); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (visible) | 245 if (visible) |
| 246 window_->Show(); | 246 window_->Show(); |
| 247 else | 247 else |
| 248 window_->Hide(); | 248 window_->Hide(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void WindowPortMus::SetOpacityFromServer(float opacity) { | 251 void WindowPortMus::SetOpacityFromServer(float opacity) { |
| 252 window_->layer()->SetOpacity(opacity); | 252 window_->layer()->SetOpacity(opacity); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void WindowPortMus::SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) { | 255 void WindowPortMus::SetPredefinedCursorFromServer( |
| 256 ui::mojom::CursorType cursor) { |
| 256 // As this does nothing more than set the cursor we don't need to use | 257 // As this does nothing more than set the cursor we don't need to use |
| 257 // ServerChange. | 258 // ServerChange. |
| 258 predefined_cursor_ = cursor; | 259 predefined_cursor_ = cursor; |
| 259 } | 260 } |
| 260 | 261 |
| 261 void WindowPortMus::SetPropertyFromServer( | 262 void WindowPortMus::SetPropertyFromServer( |
| 262 const std::string& property_name, | 263 const std::string& property_name, |
| 263 const std::vector<uint8_t>* property_data) { | 264 const std::vector<uint8_t>* property_data) { |
| 264 ServerChangeData data; | 265 ServerChangeData data; |
| 265 data.property_name = property_name; | 266 data.property_name = property_name; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 483 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
| 483 // TODO(sky): investigate to see if we need to compare data. In particular do | 484 // TODO(sky): investigate to see if we need to compare data. In particular do |
| 484 // we ever have a case where changing a property cascades into changing the | 485 // we ever have a case where changing a property cascades into changing the |
| 485 // same property? | 486 // same property? |
| 486 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 487 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
| 487 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, | 488 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, |
| 488 std::move(data)); | 489 std::move(data)); |
| 489 } | 490 } |
| 490 | 491 |
| 491 } // namespace aura | 492 } // namespace aura |
| OLD | NEW |