| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "examples/bitmap_uploader/bitmap_uploader.h" | 9 #include "examples/bitmap_uploader/bitmap_uploader.h" |
| 10 #include "examples/window_manager/window_manager.mojom.h" | 10 #include "examples/window_manager/window_manager.mojom.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Overridden from ApplicationImpl: | 53 // Overridden from ApplicationImpl: |
| 54 virtual bool ConfigureIncomingConnection( | 54 virtual bool ConfigureIncomingConnection( |
| 55 ApplicationConnection* connection) override { | 55 ApplicationConnection* connection) override { |
| 56 connection->ConnectToService(&window_manager_); | 56 connection->ConnectToService(&window_manager_); |
| 57 connection->AddService(view_manager_client_factory_.get()); | 57 connection->AddService(view_manager_client_factory_.get()); |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Overridden from ViewManagerDelegate: | 61 // Overridden from ViewManagerDelegate: |
| 62 virtual void OnEmbed(View* root, | 62 virtual void OnEmbed(View* root, |
| 63 ServiceProviderImpl* exported_services, | 63 InterfaceRequest<ServiceProvider> services, |
| 64 scoped_ptr<ServiceProvider> imported_services) override { | 64 ServiceProviderPtr exposed_services) override { |
| 65 root->AddObserver(this); | 65 root->AddObserver(this); |
| 66 bitmap_uploader_.reset(new BitmapUploader(root)); | 66 bitmap_uploader_.reset(new BitmapUploader(root)); |
| 67 bitmap_uploader_->Init(shell_); | 67 bitmap_uploader_->Init(shell_); |
| 68 bitmap_uploader_->SetColor(SK_ColorCYAN); | 68 bitmap_uploader_->SetColor(SK_ColorCYAN); |
| 69 | 69 |
| 70 nested_ = root->view_manager()->CreateView(); | 70 nested_ = root->view_manager()->CreateView(); |
| 71 root->AddChild(nested_); | 71 root->AddChild(nested_); |
| 72 Rect rect; | 72 Rect rect; |
| 73 rect.x = rect.y = 20; | 73 rect.x = rect.y = 20; |
| 74 rect.width = rect.height = 50; | 74 rect.width = rect.height = 50; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 100 DISALLOW_COPY_AND_ASSIGN(NestingApp); | 100 DISALLOW_COPY_AND_ASSIGN(NestingApp); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace examples | 103 } // namespace examples |
| 104 } // namespace mojo | 104 } // namespace mojo |
| 105 | 105 |
| 106 MojoResult MojoMain(MojoHandle shell_handle) { | 106 MojoResult MojoMain(MojoHandle shell_handle) { |
| 107 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); | 107 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); |
| 108 return runner.Run(shell_handle); | 108 return runner.Run(shell_handle); |
| 109 } | 109 } |
| OLD | NEW |