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 "view_manager/cpp/view.h" | 5 #include "view_manager/cpp/view.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "mojo/public/cpp/application/service_provider_impl.h" | 10 #include "mojo/public/cpp/application/service_provider_impl.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 370 } |
371 | 371 |
372 //////////////////////////////////////////////////////////////////////////////// | 372 //////////////////////////////////////////////////////////////////////////////// |
373 // View, protected: | 373 // View, protected: |
374 | 374 |
375 namespace { | 375 namespace { |
376 | 376 |
377 ViewportMetricsPtr CreateEmptyViewportMetrics() { | 377 ViewportMetricsPtr CreateEmptyViewportMetrics() { |
378 ViewportMetricsPtr metrics = ViewportMetrics::New(); | 378 ViewportMetricsPtr metrics = ViewportMetrics::New(); |
379 metrics->size = Size::New(); | 379 metrics->size = Size::New(); |
380 // TODO(vtl): The |.Pass()| below is only needed due to an MSVS bug; remove it | 380 return metrics; |
381 // once that's fixed. | |
382 return metrics.Pass(); | |
383 } | 381 } |
384 | 382 |
385 } // namespace | 383 } // namespace |
386 | 384 |
387 View::View() | 385 View::View() |
388 : manager_(NULL), | 386 : manager_(NULL), |
389 id_(static_cast<Id>(-1)), | 387 id_(static_cast<Id>(-1)), |
390 parent_(NULL), | 388 parent_(NULL), |
391 viewport_metrics_(CreateEmptyViewportMetrics()), | 389 viewport_metrics_(CreateEmptyViewportMetrics()), |
392 visible_(true), | 390 visible_(true), |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 bool View::PrepareForEmbed() { | 572 bool View::PrepareForEmbed() { |
575 if (!OwnsView(manager_, this)) | 573 if (!OwnsView(manager_, this)) |
576 return false; | 574 return false; |
577 | 575 |
578 while (!children_.empty()) | 576 while (!children_.empty()) |
579 RemoveChild(children_[0]); | 577 RemoveChild(children_[0]); |
580 return true; | 578 return true; |
581 } | 579 } |
582 | 580 |
583 } // namespace mojo | 581 } // namespace mojo |
OLD | NEW |