| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 void LayoutNodes() { | 284 void LayoutNodes() { |
| 285 Node* root = content_node_->parent(); | 285 Node* root = content_node_->parent(); |
| 286 gfx::Rect control_bounds(root->bounds().width(), 28); | 286 gfx::Rect control_bounds(root->bounds().width(), 28); |
| 287 control_node_->SetBounds(control_bounds); | 287 control_node_->SetBounds(control_bounds); |
| 288 gfx::Rect content_bounds(0, control_bounds.height(), root->bounds().width(), | 288 gfx::Rect content_bounds(0, control_bounds.height(), root->bounds().width(), |
| 289 root->bounds().height() - control_bounds.height()); | 289 root->bounds().height() - control_bounds.height()); |
| 290 content_node_->SetBounds(content_bounds); | 290 content_node_->SetBounds(content_bounds); |
| 291 } | 291 } |
| 292 | 292 |
| 293 // Overridden from ViewManagerDelegate: | 293 // Overridden from ViewManagerDelegate: |
| 294 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { | 294 virtual void OnEmbed(ViewManager* view_manager, |
| 295 Node* root, |
| 296 ExportedServiceRegistry* exported_services, |
| 297 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
| 295 root_node_ = root; | 298 root_node_ = root; |
| 296 view_manager_ = view_manager; | 299 view_manager_ = view_manager; |
| 297 | 300 |
| 298 control_node_ = Node::Create(view_manager_); | 301 control_node_ = Node::Create(view_manager_); |
| 299 root_node_->AddChild(control_node_); | 302 root_node_->AddChild(control_node_); |
| 300 | 303 |
| 301 content_node_ = Node::Create(view_manager_); | 304 content_node_ = Node::Create(view_manager_); |
| 302 root_node_->AddChild(content_node_); | 305 root_node_->AddChild(content_node_); |
| 303 | 306 |
| 304 control_node_->SetActiveView(View::Create(view_manager_)); | 307 control_node_->SetActiveView(View::Create(view_manager_)); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 386 } |
| 384 | 387 |
| 385 } // namespace examples | 388 } // namespace examples |
| 386 | 389 |
| 387 // static | 390 // static |
| 388 ApplicationDelegate* ApplicationDelegate::Create() { | 391 ApplicationDelegate* ApplicationDelegate::Create() { |
| 389 return new examples::MediaViewer; | 392 return new examples::MediaViewer; |
| 390 } | 393 } |
| 391 | 394 |
| 392 } // namespace mojo | 395 } // namespace mojo |
| OLD | NEW |