diff options
author | sky <sky@chromium.org> | 2015-08-12 12:19:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-12 19:20:29 +0000 |
commit | 88d7709e7b708e6bb58cc920bd9e13c5102b2d22 (patch) | |
tree | 4ed45f404bcea495d052c0bf63915548e0642314 /mandoline | |
parent | 77b18c5ae36b9f3372e17268db04f3bd795522ba (diff) | |
download | chromium_src-88d7709e7b708e6bb58cc920bd9e13c5102b2d22.zip chromium_src-88d7709e7b708e6bb58cc920bd9e13c5102b2d22.tar.gz chromium_src-88d7709e7b708e6bb58cc920bd9e13c5102b2d22.tar.bz2 |
Gets //mandoline passing gn check
BUG=none
TEST=none
R=ben@chromium.org
Committed: https://crrev.com/c202fc81d0b4931cb928672e5cd226e51e501ea9
Cr-Commit-Position: refs/heads/master@{#342890}
Review URL: https://codereview.chromium.org/1278803006
Cr-Commit-Position: refs/heads/master@{#343067}
Diffstat (limited to 'mandoline')
-rw-r--r-- | mandoline/app/android/BUILD.gn | 2 | ||||
-rw-r--r-- | mandoline/app/desktop/main.cc | 3 | ||||
-rw-r--r-- | mandoline/services/core_services/BUILD.gn | 9 | ||||
-rw-r--r-- | mandoline/services/core_services/application_delegate_factory.h | 37 | ||||
-rw-r--r-- | mandoline/services/core_services/application_delegate_factory_aura.cc | 17 | ||||
-rw-r--r-- | mandoline/services/core_services/application_delegate_factory_default.cc | 16 | ||||
-rw-r--r-- | mandoline/services/core_services/application_delegate_factory_linux.cc | 18 | ||||
-rw-r--r-- | mandoline/services/core_services/application_delegate_factory_notandroid.cc | 26 | ||||
-rw-r--r-- | mandoline/services/core_services/core_services_application_delegate.cc | 41 | ||||
-rw-r--r-- | mandoline/services/core_services/core_services_application_delegate.h | 6 | ||||
-rw-r--r-- | mandoline/services/updater/BUILD.gn | 1 | ||||
-rw-r--r-- | mandoline/tab/BUILD.gn | 2 | ||||
-rw-r--r-- | mandoline/ui/aura/BUILD.gn | 1 | ||||
-rw-r--r-- | mandoline/ui/browser/BUILD.gn | 12 | ||||
-rw-r--r-- | mandoline/ui/omnibox/BUILD.gn | 4 |
15 files changed, 155 insertions, 40 deletions
diff --git a/mandoline/app/android/BUILD.gn b/mandoline/app/android/BUILD.gn index e5f9f59..4124182 100644 --- a/mandoline/app/android/BUILD.gn +++ b/mandoline/app/android/BUILD.gn @@ -19,9 +19,11 @@ group("android") { executable("mandoline_runner") { deps = [ ":jni_headers", + "//base", "//mandoline/ui/browser/public/interfaces", "//mojo/common", "//mojo/environment:chromium", + "//mojo/runner:lib", "//mojo/runner:mojo_runner_lib", ] diff --git a/mandoline/app/desktop/main.cc b/mandoline/app/desktop/main.cc index 59a5d90..a1e26aa 100644 --- a/mandoline/app/desktop/main.cc +++ b/mandoline/app/desktop/main.cc @@ -3,14 +3,11 @@ // found in the LICENSE file. #include "base/at_exit.h" -#include "base/bind.h" #include "base/command_line.h" -#include "base/files/file_path.h" #include "mandoline/app/desktop/launcher_process.h" #include "mojo/runner/child_process.h" #include "mojo/runner/init.h" #include "mojo/runner/switches.h" -#include "mojo/shell/native_runner.h" int main(int argc, char** argv) { base::CommandLine::Init(argc, argv); diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn index 84f6f28..cb8d9f9 100644 --- a/mandoline/services/core_services/BUILD.gn +++ b/mandoline/services/core_services/BUILD.gn @@ -36,6 +36,8 @@ mojo_native_application("core_services") { source_set("sources") { sources = [ + "application_delegate_factory.h", + "application_delegate_factory_linux.cc", "core_services_application_delegate.cc", "main.cc", ] @@ -51,9 +53,11 @@ source_set("sources") { "//mojo/message_pump", "//mojo/services/tracing:lib", "//third_party/mojo/src/mojo/public/cpp/bindings", + "//url", ] if (!is_android) { + sources += [ "application_delegate_factory_notandroid.cc" ] deps += [ "//components/resource_provider:lib", "//components/view_manager:lib", @@ -61,8 +65,10 @@ source_set("sources") { ] } - if (is_linux && !is_android) { + if (is_linux) { deps += [ "//components/font_service:lib" ] + } else { + sources += [ "application_delegate_factory_default.cc" ] } if (use_aura) { @@ -70,5 +76,6 @@ source_set("sources") { "//components/view_manager/public/cpp", "//mandoline/ui/omnibox:lib", ] + sources += [ "application_delegate_factory_aura.cc" ] } } diff --git a/mandoline/services/core_services/application_delegate_factory.h b/mandoline/services/core_services/application_delegate_factory.h new file mode 100644 index 0000000..d92bc68 --- /dev/null +++ b/mandoline/services/core_services/application_delegate_factory.h @@ -0,0 +1,37 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MANDOLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_FACTORY_H_ +#define MANDOLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_FACTORY_H_ + +#include <string> + +#include "base/memory/scoped_ptr.h" + +namespace mojo { +class ApplicationDelegate; +} + +namespace core_services { + +// This is always called to create a platform specific ApplicationDelegate. +scoped_ptr<mojo::ApplicationDelegate> CreatePlatformSpecificApplicationDelegate( + const std::string& url); + +// The following are conditionally called. You do not need to call these from +// CreatePlatformSpecificApplicationDelegate(), they are called (if appropriate) +// before CreatePlatformSpecificApplicationDelegate(). +#if !defined(OS_ANDROID) +scoped_ptr<mojo::ApplicationDelegate> CreateApplicationDelegateNotAndroid( + const std::string& url); +#endif + +#if defined(USE_AURA) +scoped_ptr<mojo::ApplicationDelegate> CreateApplicationDelegateAura( + const std::string& url); +#endif + +} // namespace core_services + +#endif // MANDOLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_FACTORY_H_ diff --git a/mandoline/services/core_services/application_delegate_factory_aura.cc b/mandoline/services/core_services/application_delegate_factory_aura.cc new file mode 100644 index 0000000..1b3f4c1 --- /dev/null +++ b/mandoline/services/core_services/application_delegate_factory_aura.cc @@ -0,0 +1,17 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mandoline/services/core_services/application_delegate_factory.h" + +#include "mandoline/ui/omnibox/omnibox_impl.h" + +namespace core_services { + +scoped_ptr<mojo::ApplicationDelegate> CreateApplicationDelegateAura( + const std::string& url) { + return url == "mojo://omnibox/" ? make_scoped_ptr(new mandoline::OmniboxImpl) + : nullptr; +} + +} // namespace core_services diff --git a/mandoline/services/core_services/application_delegate_factory_default.cc b/mandoline/services/core_services/application_delegate_factory_default.cc new file mode 100644 index 0000000..d4c6d5b --- /dev/null +++ b/mandoline/services/core_services/application_delegate_factory_default.cc @@ -0,0 +1,16 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mandoline/services/core_services/application_delegate_factory.h" + +#include "mojo/application/public/cpp/application_delegate.h" + +namespace core_services { + +scoped_ptr<mojo::ApplicationDelegate> CreatePlatformSpecificApplicationDelegate( + const std::string& url) { + return nullptr; +} + +} // namespace core_services diff --git a/mandoline/services/core_services/application_delegate_factory_linux.cc b/mandoline/services/core_services/application_delegate_factory_linux.cc new file mode 100644 index 0000000..fe14ee4 --- /dev/null +++ b/mandoline/services/core_services/application_delegate_factory_linux.cc @@ -0,0 +1,18 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mandoline/services/core_services/application_delegate_factory.h" + +#include "components/font_service/font_service_app.h" + +namespace core_services { + +scoped_ptr<mojo::ApplicationDelegate> CreatePlatformSpecificApplicationDelegate( + const std::string& url) { + return url == "mojo://font_service/" + ? make_scoped_ptr(new font_service::FontServiceApp) + : nullptr; +} + +} // namespace core_services diff --git a/mandoline/services/core_services/application_delegate_factory_notandroid.cc b/mandoline/services/core_services/application_delegate_factory_notandroid.cc new file mode 100644 index 0000000..f56a1b4 --- /dev/null +++ b/mandoline/services/core_services/application_delegate_factory_notandroid.cc @@ -0,0 +1,26 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mandoline/services/core_services/application_delegate_factory.h" + +#include "components/resource_provider/resource_provider_app.h" +#include "components/view_manager/view_manager_app.h" +#include "mojo/services/network/network_service_delegate.h" + +namespace core_services { + +scoped_ptr<mojo::ApplicationDelegate> CreateApplicationDelegateNotAndroid( + const std::string& url) { + if (url == "mojo://network_service/") + return make_scoped_ptr(new mojo::NetworkServiceDelegate); + if (url == "mojo://resource_provider/") { + return make_scoped_ptr( + new resource_provider::ResourceProviderApp("mojo:core_services")); + } + if (url == "mojo://view_manager/") + return make_scoped_ptr(new view_manager::ViewManagerApp); + return nullptr; +} + +} // namespace core_services diff --git a/mandoline/services/core_services/core_services_application_delegate.cc b/mandoline/services/core_services/core_services_application_delegate.cc index d3ef946..01e4e51 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( diff --git a/mandoline/services/core_services/core_services_application_delegate.h b/mandoline/services/core_services/core_services_application_delegate.h index 5a25cf0..f12f00f3 100644 --- a/mandoline/services/core_services/core_services_application_delegate.h +++ b/mandoline/services/core_services/core_services_application_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MANDOLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ -#define MANDOLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ +#ifndef MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ +#define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ #include "base/macros.h" #include "base/memory/scoped_vector.h" @@ -57,4 +57,4 @@ class CoreServicesApplicationDelegate } // namespace core_services -#endif // MANDONLINE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ +#endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ diff --git a/mandoline/services/updater/BUILD.gn b/mandoline/services/updater/BUILD.gn index 2415b84..31edf86 100644 --- a/mandoline/services/updater/BUILD.gn +++ b/mandoline/services/updater/BUILD.gn @@ -19,5 +19,6 @@ mojo_native_application("updater") { "//mojo/application/public/cpp", "//mojo/services/updater", "//third_party/mojo/src/mojo/public/cpp/system", + "//url", ] } diff --git a/mandoline/tab/BUILD.gn b/mandoline/tab/BUILD.gn index 8d96d2e..dba9e10 100644 --- a/mandoline/tab/BUILD.gn +++ b/mandoline/tab/BUILD.gn @@ -37,6 +37,7 @@ source_set("test_support") { ] deps = [ ":tab", + "//base", ] } @@ -55,6 +56,7 @@ mojo_native_application("mandoline_frame_apptests") { "//components/view_manager/public/cpp", "//components/view_manager/public/interfaces", "//mandoline/tab/public/interfaces", + "//mojo/application/public/cpp:sources", "//mojo/application/public/cpp:test_support", "//ui/mojo/geometry:interfaces", "//ui/mojo/geometry:util", diff --git a/mandoline/ui/aura/BUILD.gn b/mandoline/ui/aura/BUILD.gn index 71226ad..965aa28 100644 --- a/mandoline/ui/aura/BUILD.gn +++ b/mandoline/ui/aura/BUILD.gn @@ -49,5 +49,6 @@ source_set("aura") { "//ui/gl", "//ui/mojo/init", "//ui/views", + "//ui/wm", ] } diff --git a/mandoline/ui/browser/BUILD.gn b/mandoline/ui/browser/BUILD.gn index 844e950..b0328f9 100644 --- a/mandoline/ui/browser/BUILD.gn +++ b/mandoline/ui/browser/BUILD.gn @@ -38,12 +38,14 @@ source_set("lib") { "//components/view_manager/public/cpp", "//mandoline/services/navigation/public/interfaces", "//mandoline/tab", - "//mojo/application/public/interfaces", + "//mojo/application/public/cpp:sources", + "//mojo/common:common_base", "//mojo/converters/geometry", "//skia", "//third_party/mojo/src/mojo/public/cpp/bindings", "//ui/gfx/geometry", "//ui/mojo/events:interfaces", + "//url", ] if (is_mac || use_aura) { @@ -51,7 +53,11 @@ source_set("lib") { "desktop/desktop_ui.cc", "desktop/desktop_ui.h", ] - deps += [ "//mandoline/ui/aura" ] + deps += [ + "//mandoline/ui/aura", + "//ui/gfx", + "//ui/views", + ] } else { assert(is_android) sources += [ @@ -71,8 +77,10 @@ mojo_native_application("mandoline_browser_apptests") { deps = [ "//base", "//base/test:test_config", + "//components/view_manager/public/cpp", "//mandoline/tab/public/interfaces", "//mandoline/ui/browser:lib", + "//mojo/application/public/cpp:sources", "//mojo/application/public/cpp:test_support", ] } diff --git a/mandoline/ui/omnibox/BUILD.gn b/mandoline/ui/omnibox/BUILD.gn index 309d009..f57424e 100644 --- a/mandoline/ui/omnibox/BUILD.gn +++ b/mandoline/ui/omnibox/BUILD.gn @@ -31,11 +31,13 @@ source_set("lib") { "//mandoline/services/navigation/public/interfaces", "//mandoline/ui/aura", "//mandoline/ui/browser/public/interfaces", - "//mojo/application/public/interfaces", + "//mojo/application/public/cpp:sources", + "//mojo/common", "//mojo/converters/geometry", "//skia", "//third_party/mojo/src/mojo/public/cpp/bindings", "//ui/gfx/geometry", "//ui/mojo/events:interfaces", + "//ui/views", ] } |