More shell cleanup: Move NativeRunner(Factory) to native_runner.h.

(I also want to move the contents of dynamic_service_runner.{h,cc} into
native_runner.{h,cc}, but apparently I have to rectify some issues with
the thunks targets first.)

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/961053005
diff --git a/shell/application_manager/application_manager.h b/shell/application_manager/application_manager.h
index 52b0ec6..38784d7 100644
--- a/shell/application_manager/application_manager.h
+++ b/shell/application_manager/application_manager.h
@@ -7,18 +7,16 @@
 
 #include <map>
 
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/gtest_prod_util.h"
+#include "base/macros.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/scoped_vector.h"
 #include "base/memory/weak_ptr.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/interfaces/application/application.mojom.h"
 #include "mojo/public/interfaces/application/service_provider.mojom.h"
 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
 #include "shell/application_manager/application_loader.h"
-#include "shell/application_manager/fetcher.h"
-#include "shell/application_manager/shell_impl.h"
+#include "shell/application_manager/native_runner.h"
 #include "url/gurl.h"
 
 namespace base {
@@ -29,42 +27,8 @@
 namespace mojo {
 namespace shell {
 
-// ApplicationManager requires implementations of NativeRunner and
-// NativeRunnerFactory to run native applications.
-class NativeRunner {
- public:
-  // Parameter for |Start()| to specify its cleanup behavior.
-  enum CleanupBehavior { DeleteAppPath, DontDeleteAppPath };
-
-  virtual ~NativeRunner() {}
-
-  // Loads the app in the file at |app_path| and runs it on some other
-  // thread/process. If |cleanup_behavior| is |true|, takes ownership of the
-  // file. |app_completed_callback| is posted (to the thread on which |Start()|
-  // was called) after |MojoMain()| completes.
-  // TODO(vtl): |app_path| and |cleanup_behavior| should probably be moved to
-  // the factory's Create(). Rationale: The factory may need information from
-  // the file to decide what kind of NativeRunner to make.
-  virtual void Start(const base::FilePath& app_path,
-                     CleanupBehavior cleanup_behavior,
-                     InterfaceRequest<Application> application_request,
-                     const base::Closure& app_completed_callback) = 0;
-};
-
-class NativeRunnerFactory {
- public:
-  // Options for running the native app. (This will contain, e.g., information
-  // about the sandbox profile, etc.)
-  struct Options {
-    // Constructs with default options.
-    Options() : force_in_process(false) {}
-
-    bool force_in_process;
-  };
-
-  virtual ~NativeRunnerFactory() {}
-  virtual scoped_ptr<NativeRunner> Create(const Options& options) = 0;
-};
+class Fetcher;
+class ShellImpl;
 
 class ApplicationManager {
  public: