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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ServiceProviderImpl* exported_services, |
64 scoped_ptr<ServiceProvider> imported_services) override { | 64 scoped_ptr<ServiceProvider> imported_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_ = View::Create(root->view_manager()); | 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; |
75 nested_->SetBounds(rect); | 75 nested_->SetBounds(rect); |
76 nested_->SetVisible(true); | 76 nested_->SetVisible(true); |
77 nested_->Embed(kEmbeddedAppURL); | 77 nested_->Embed(kEmbeddedAppURL); |
78 } | 78 } |
79 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { | 79 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { |
80 base::MessageLoop::current()->Quit(); | 80 base::MessageLoop::current()->Quit(); |
(...skipping 19 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 |