| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 root->AddChild(nested_); | 72 root->AddChild(nested_); |
| 73 Rect rect; | 73 Rect rect; |
| 74 rect.x = rect.y = 20; | 74 rect.x = rect.y = 20; |
| 75 rect.width = rect.height = 50; | 75 rect.width = rect.height = 50; |
| 76 nested_->SetBounds(rect); | 76 nested_->SetBounds(rect); |
| 77 nested_->SetVisible(true); |
| 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 } |
| 82 | 83 |
| 83 // Overridden from ViewObserver: | 84 // Overridden from ViewObserver: |
| 84 virtual void OnViewDestroyed(View* view) override { | 85 virtual void OnViewDestroyed(View* view) override { |
| 85 // TODO(beng): reap views & child Views. | 86 // TODO(beng): reap views & child Views. |
| 86 nested_ = NULL; | 87 nested_ = NULL; |
| (...skipping 13 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 |