Mojo JS Bindings: add show_image example
Add a simple example based on the window and view managers. The skydb app can now handle apps that want to embed another view. Corrected a problem in unique module name generation. An otherwise unique module name could be shadowed by a parameter name (service_provider in ViewManagerService Embed). Appended a "$" suffix to module names to avoid the collision. BUG= R=eseidel@chromium.org Review URL: https://codereview.chromium.org/845103004
This commit is contained in:
@@ -10,7 +10,7 @@ namespace sky {
|
||||
namespace debugger {
|
||||
|
||||
SkyDebugger::SkyDebugger()
|
||||
: window_manager_app_(new window_manager::WindowManagerApp(this, nullptr)),
|
||||
: window_manager_app_(new window_manager::WindowManagerApp(this, this)),
|
||||
root_(nullptr),
|
||||
content_(nullptr),
|
||||
navigator_host_factory_(this),
|
||||
@@ -64,6 +64,15 @@ void SkyDebugger::OnEmbed(
|
||||
NavigateToURL(pending_url_);
|
||||
}
|
||||
|
||||
void SkyDebugger::Embed(
|
||||
const mojo::String& url,
|
||||
mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) {
|
||||
scoped_ptr<mojo::ServiceProviderImpl> exported_services(
|
||||
new mojo::ServiceProviderImpl());
|
||||
// exported_services->AddService(TBD) -- no exported services for now.
|
||||
content_->Embed(url, exported_services.Pass());
|
||||
}
|
||||
|
||||
void SkyDebugger::OnViewManagerDisconnected(mojo::ViewManager* view_manager) {
|
||||
root_ = nullptr;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ class SkyDebugger : public mojo::ApplicationDelegate,
|
||||
public mojo::ViewManagerDelegate,
|
||||
public mojo::ViewObserver,
|
||||
public mojo::InterfaceFactory<Debugger>,
|
||||
public mojo::InterfaceImpl<Debugger> {
|
||||
public mojo::InterfaceImpl<Debugger>,
|
||||
public window_manager::WindowManagerDelegate {
|
||||
public:
|
||||
SkyDebugger();
|
||||
virtual ~SkyDebugger();
|
||||
@@ -61,6 +62,11 @@ class SkyDebugger : public mojo::ApplicationDelegate,
|
||||
void Create(mojo::ApplicationConnection* connection,
|
||||
mojo::InterfaceRequest<Debugger> request) override;
|
||||
|
||||
// Overridden from WindowManagerDelegate
|
||||
void Embed(
|
||||
const mojo::String& url,
|
||||
mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) override;
|
||||
|
||||
scoped_ptr<window_manager::WindowManagerApp> window_manager_app_;
|
||||
|
||||
mojo::View* root_;
|
||||
|
||||
Reference in New Issue
Block a user