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

Unified Diff: mandoline/services/core_services/core_services_application_delegate.cc

Issue 1278803006: Gets //mandoline passing gn check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: notandroid Created 5 years, 4 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
Index: mandoline/services/core_services/core_services_application_delegate.cc
diff --git a/mandoline/services/core_services/core_services_application_delegate.cc b/mandoline/services/core_services/core_services_application_delegate.cc
index d3ef94685acfcf9fe628be02b56a7b2d8b87b8ed..01e4e51d2f5acee4231b6e7bc33bfb6cc8270888 100644
--- a/mandoline/services/core_services/core_services_application_delegate.cc
+++ b/mandoline/services/core_services/core_services_application_delegate.cc
@@ -10,6 +10,7 @@
#include "components/clipboard/clipboard_application_delegate.h"
#include "components/filesystem/file_system_app.h"
#include "components/view_manager/surfaces/surfaces_service_application.h"
+#include "mandoline/services/core_services/application_delegate_factory.h"
#include "mandoline/ui/browser/browser_manager.h"
#include "mojo/application/public/cpp/application_connection.h"
#include "mojo/application/public/cpp/application_impl.h"
@@ -18,20 +19,6 @@
#include "mojo/services/tracing/tracing_app.h"
#include "url/gurl.h"
-#if defined(USE_AURA)
-#include "mandoline/ui/omnibox/omnibox_impl.h"
-#endif
-
-#if !defined(OS_ANDROID)
-#include "components/resource_provider/resource_provider_app.h"
-#include "components/view_manager/view_manager_app.h"
-#include "mojo/services/network/network_service_delegate.h"
-#endif
-
-#if defined(OS_LINUX) && !defined(OS_ANDROID)
-#include "components/font_service/font_service_app.h"
-#endif
-
namespace core_services {
// A helper class for hosting a mojo::ApplicationImpl on its own thread.
@@ -125,7 +112,7 @@ void CoreServicesApplicationDelegate::Create(
void CoreServicesApplicationDelegate::StartApplication(
mojo::InterfaceRequest<mojo::Application> request,
mojo::URLResponsePtr response) {
- std::string url = response->url;
+ const std::string url = response->url;
scoped_ptr<mojo::ApplicationDelegate> delegate;
if (url == "mojo://browser/") {
@@ -134,29 +121,23 @@ void CoreServicesApplicationDelegate::StartApplication(
delegate.reset(new clipboard::ClipboardApplicationDelegate);
} else if (url == "mojo://filesystem/") {
delegate.reset(new filesystem::FileSystemApp);
-#if defined(OS_LINUX) && !defined(OS_ANDROID)
- } else if (url == "mojo://font_service/") {
- delegate.reset(new font_service::FontServiceApp);
-#endif
} else if (url == "mojo://surfaces_service/") {
delegate.reset(new surfaces::SurfacesServiceApplication);
} else if (url == "mojo://tracing/") {
delegate.reset(new tracing::TracingApp);
+ } else {
#if defined(USE_AURA)
- } else if (url == "mojo://omnibox/") {
- delegate.reset(new mandoline::OmniboxImpl);
+ delegate = CreateApplicationDelegateAura(url);
#endif
#if !defined(OS_ANDROID)
- } else if (url == "mojo://network_service/") {
- delegate.reset(new mojo::NetworkServiceDelegate);
- } else if (url == "mojo://resource_provider/") {
- delegate.reset(
- new resource_provider::ResourceProviderApp("mojo:core_services"));
- } else if (url == "mojo://view_manager/") {
- delegate.reset(new view_manager::ViewManagerApp);
+ if (!delegate)
+ delegate = CreateApplicationDelegateNotAndroid(url);
#endif
- } else {
- NOTREACHED() << "This application package does not support " << url;
+ if (!delegate)
+ delegate = CreatePlatformSpecificApplicationDelegate(url);
+
+ if (!delegate)
+ NOTREACHED() << "This application package does not support " << url;
}
scoped_ptr<ApplicationThread> thread(
« no previous file with comments | « mandoline/services/core_services/core_services_application_delegate.h ('k') | mandoline/services/updater/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698