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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 virtual void OnEmbed(ViewManager* view_manager, | 62 virtual void OnEmbed(ViewManager* view_manager, |
63 View* root, | 63 View* root, |
64 ServiceProviderImpl* exported_services, | 64 ServiceProviderImpl* exported_services, |
65 scoped_ptr<ServiceProvider> imported_services) override { | 65 scoped_ptr<ServiceProvider> imported_services) override { |
66 root->AddObserver(this); | 66 root->AddObserver(this); |
67 bitmap_uploader_.reset(new BitmapUploader(root)); | 67 bitmap_uploader_.reset(new BitmapUploader(root)); |
68 bitmap_uploader_->Init(shell_); | 68 bitmap_uploader_->Init(shell_); |
69 bitmap_uploader_->SetColor(SK_ColorCYAN); | 69 bitmap_uploader_->SetColor(SK_ColorCYAN); |
70 | 70 |
71 nested_ = View::Create(view_manager); | 71 nested_ = View::Create(view_manager); |
72 nested_->SetVisible(true); | |
Elliot Glaysher
2014/11/20 20:34:37
If you're going to add SetVisible() calls to let p
sky
2014/11/20 20:51:30
I'm actually doing this more for animations. But p
| |
72 root->AddChild(nested_); | 73 root->AddChild(nested_); |
73 Rect rect; | 74 Rect rect; |
74 rect.x = rect.y = 20; | 75 rect.x = rect.y = 20; |
75 rect.width = rect.height = 50; | 76 rect.width = rect.height = 50; |
76 nested_->SetBounds(rect); | 77 nested_->SetBounds(rect); |
77 nested_->Embed(kEmbeddedAppURL); | 78 nested_->Embed(kEmbeddedAppURL); |
78 } | 79 } |
79 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { | 80 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { |
80 base::MessageLoop::current()->Quit(); | 81 base::MessageLoop::current()->Quit(); |
81 } | 82 } |
(...skipping 18 matching lines...) Expand all Loading... | |
100 DISALLOW_COPY_AND_ASSIGN(NestingApp); | 101 DISALLOW_COPY_AND_ASSIGN(NestingApp); |
101 }; | 102 }; |
102 | 103 |
103 } // namespace examples | 104 } // namespace examples |
104 } // namespace mojo | 105 } // namespace mojo |
105 | 106 |
106 MojoResult MojoMain(MojoHandle shell_handle) { | 107 MojoResult MojoMain(MojoHandle shell_handle) { |
107 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); | 108 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); |
108 return runner.Run(shell_handle); | 109 return runner.Run(shell_handle); |
109 } | 110 } |
OLD | NEW |