| 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 | |
| 9 #include <string> | 8 #include <string> |
| 10 #include <utility> | 9 #include <utility> |
| 11 #include <vector> | 10 #include <vector> |
| 12 | 11 |
| 13 #include "base/bind.h" | 12 #include "base/bind.h" |
| 14 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 15 #include "services/service_manager/public/cpp/connector.h" | 14 #include "services/service_manager/public/cpp/connector.h" |
| 16 #include "services/ui/common/util.h" | 15 #include "services/ui/common/util.h" |
| 17 #include "services/ui/public/cpp/in_flight_change.h" | 16 #include "services/ui/public/cpp/in_flight_change.h" |
| 18 #include "services/ui/public/cpp/input_event_handler.h" | 17 #include "services/ui/public/cpp/input_event_handler.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 495 } |
| 497 return root; | 496 return root; |
| 498 } | 497 } |
| 499 | 498 |
| 500 Window* WindowTreeClient::NewWindowImpl( | 499 Window* WindowTreeClient::NewWindowImpl( |
| 501 NewWindowType type, | 500 NewWindowType type, |
| 502 const Window::SharedProperties* properties) { | 501 const Window::SharedProperties* properties) { |
| 503 DCHECK(tree_); | 502 DCHECK(tree_); |
| 504 Window* window = | 503 Window* window = |
| 505 new Window(this, MakeTransportId(client_id_, next_window_id_++)); | 504 new Window(this, MakeTransportId(client_id_, next_window_id_++)); |
| 505 |
| 506 if (properties) | 506 if (properties) |
| 507 window->properties_ = *properties; | 507 window->properties_ = *properties; |
| 508 |
| 508 AddWindow(window); | 509 AddWindow(window); |
| 509 | 510 |
| 510 const uint32_t change_id = | 511 const uint32_t change_id = |
| 511 ScheduleInFlightChange(base::MakeUnique<CrashInFlightChange>( | 512 ScheduleInFlightChange(base::MakeUnique<CrashInFlightChange>( |
| 512 window, type == NewWindowType::CHILD | 513 window, type == NewWindowType::CHILD |
| 513 ? ChangeType::NEW_WINDOW | 514 ? ChangeType::NEW_WINDOW |
| 514 : ChangeType::NEW_TOP_LEVEL_WINDOW)); | 515 : ChangeType::NEW_TOP_LEVEL_WINDOW)); |
| 515 mojo::Map<mojo::String, mojo::Array<uint8_t>> transport_properties; | 516 mojo::Map<mojo::String, mojo::Array<uint8_t>> transport_properties; |
| 516 if (properties) { | 517 if (properties) { |
| 517 transport_properties = | 518 transport_properties = |
| 518 mojo::Map<mojo::String, mojo::Array<uint8_t>>::From(*properties); | 519 mojo::Map<mojo::String, mojo::Array<uint8_t>>::From(*properties); |
| 519 } | 520 } |
| 520 if (type == NewWindowType::CHILD) { | 521 if (type == NewWindowType::CHILD) { |
| 522 // LOG(ERROR) << "\n\n WindowTreeClient::NewWindowImpl |
| 523 // transport_properties "; |
| 524 // for (auto i = transport_properties.begin(); i != |
| 525 // transport_properties.end(); ++i) |
| 526 // { |
| 527 // LOG(ERROR) << "\n transport_properties->first " << i->first; |
| 528 // // do something with it here like adding it to a vector |
| 529 // } |
| 530 |
| 521 tree_->NewWindow(change_id, server_id(window), | 531 tree_->NewWindow(change_id, server_id(window), |
| 522 std::move(transport_properties)); | 532 std::move(transport_properties)); |
| 523 } else { | 533 } else { |
| 524 roots_.insert(window); | 534 roots_.insert(window); |
| 525 tree_->NewTopLevelWindow(change_id, server_id(window), | 535 tree_->NewTopLevelWindow(change_id, server_id(window), |
| 526 std::move(transport_properties)); | 536 std::move(transport_properties)); |
| 527 } | 537 } |
| 528 return window; | 538 return window; |
| 529 } | 539 } |
| 530 | 540 |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 Window* window, | 1448 Window* window, |
| 1439 const gfx::Vector2d& offset, | 1449 const gfx::Vector2d& offset, |
| 1440 const gfx::Insets& hit_area) { | 1450 const gfx::Insets& hit_area) { |
| 1441 if (window_manager_internal_client_) { | 1451 if (window_manager_internal_client_) { |
| 1442 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1452 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1443 server_id(window), offset.x(), offset.y(), hit_area); | 1453 server_id(window), offset.x(), offset.y(), hit_area); |
| 1444 } | 1454 } |
| 1445 } | 1455 } |
| 1446 | 1456 |
| 1447 } // namespace ui | 1457 } // namespace ui |
| OLD | NEW |