Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: examples/ui/png_viewer/png_viewer.cc

Issue 2020453003: Convert ViewProviderApp and ContentViewerApp to implement ApplicationImplBase instead of Applicatio… (Closed) Base URL: https://github.com/domokit/mojo.git@work796_no_run_main_app
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/ui/pdf_viewer/pdf_viewer.cc ('k') | examples/ui/shapes/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ui/png_viewer/png_viewer.cc
diff --git a/examples/ui/png_viewer/png_viewer.cc b/examples/ui/png_viewer/png_viewer.cc
index 6e895234df02351ccb2165516905201c1588314f..2ad6551012a2cfe21ec178bd413299de2f843a02 100644
--- a/examples/ui/png_viewer/png_viewer.cc
+++ b/examples/ui/png_viewer/png_viewer.cc
@@ -7,12 +7,14 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "mojo/application/application_runner_chromium.h"
#include "mojo/data_pipe_utils/data_pipe_utils.h"
+#include "mojo/environment/scoped_chromium_init.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/ui/content_viewer_app.h"
#include "mojo/ui/ganesh_view.h"
+#include "mojo/ui/view_provider_app.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
@@ -121,7 +123,7 @@ class PNGContentViewProviderApp : public mojo::ui::ViewProviderApp {
const std::string& connection_url,
mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
mojo::InterfaceRequest<mojo::ServiceProvider> services) override {
- new PNGView(mojo::CreateApplicationConnector(app_impl()->shell()),
+ new PNGView(mojo::CreateApplicationConnector(shell()),
view_owner_request.Pass(), image_);
}
@@ -161,6 +163,7 @@ class PNGContentViewerApp : public mojo::ui::ContentViewerApp {
} // namespace examples
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunnerChromium runner(new examples::PNGContentViewerApp());
- return runner.Run(application_request);
+ mojo::ScopedChromiumInit init;
+ examples::PNGContentViewerApp png_content_viewer_app;
+ return mojo::RunApplication(application_request, &png_content_viewer_app);
}
« no previous file with comments | « examples/ui/pdf_viewer/pdf_viewer.cc ('k') | examples/ui/shapes/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698