| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 content_bounds.height = root->bounds().height - control_bounds.height; | 241 content_bounds.height = root->bounds().height - control_bounds.height; |
| 242 content_view_->SetBounds(content_bounds); | 242 content_view_->SetBounds(content_bounds); |
| 243 } | 243 } |
| 244 | 244 |
| 245 // Overridden from ViewManagerDelegate: | 245 // Overridden from ViewManagerDelegate: |
| 246 virtual void OnEmbed(View* root, | 246 virtual void OnEmbed(View* root, |
| 247 ServiceProviderImpl* exported_services, | 247 ServiceProviderImpl* exported_services, |
| 248 scoped_ptr<ServiceProvider> imported_services) override { | 248 scoped_ptr<ServiceProvider> imported_services) override { |
| 249 root_view_ = root; | 249 root_view_ = root; |
| 250 | 250 |
| 251 control_view_ = View::Create(root->view_manager()); | 251 control_view_ = root->view_manager()->CreateView(); |
| 252 control_view_->SetVisible(true); | 252 control_view_->SetVisible(true); |
| 253 root_view_->AddChild(control_view_); | 253 root_view_->AddChild(control_view_); |
| 254 | 254 |
| 255 content_view_ = View::Create(root->view_manager()); | 255 content_view_ = root->view_manager()->CreateView(); |
| 256 content_view_->SetVisible(true); | 256 content_view_->SetVisible(true); |
| 257 root_view_->AddChild(content_view_); | 257 root_view_->AddChild(content_view_); |
| 258 | 258 |
| 259 control_panel_.Initialize(control_view_, shell_); | 259 control_panel_.Initialize(control_view_, shell_); |
| 260 | 260 |
| 261 LayoutViews(); | 261 LayoutViews(); |
| 262 root_view_->AddObserver(this); | 262 root_view_->AddObserver(this); |
| 263 | 263 |
| 264 content_view_->Embed("TODO"); | 264 content_view_->Embed("TODO"); |
| 265 } | 265 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 DISALLOW_COPY_AND_ASSIGN(MediaViewer); | 319 DISALLOW_COPY_AND_ASSIGN(MediaViewer); |
| 320 }; | 320 }; |
| 321 | 321 |
| 322 } // namespace examples | 322 } // namespace examples |
| 323 } // namespace mojo | 323 } // namespace mojo |
| 324 | 324 |
| 325 MojoResult MojoMain(MojoHandle shell_handle) { | 325 MojoResult MojoMain(MojoHandle shell_handle) { |
| 326 mojo::ApplicationRunnerChromium runner(new mojo::examples::MediaViewer); | 326 mojo::ApplicationRunnerChromium runner(new mojo::examples::MediaViewer); |
| 327 return runner.Run(shell_handle); | 327 return runner.Run(shell_handle); |
| 328 } | 328 } |
| OLD | NEW |