Use the mojo::shell namespace consistently under shell/.

(Esp. under shell/application_manager/.)

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/972433004
diff --git a/services/window_manager/window_manager_api_unittest.cc b/services/window_manager/window_manager_api_unittest.cc
index 8b6a5d6..d1557bb 100644
--- a/services/window_manager/window_manager_api_unittest.cc
+++ b/services/window_manager/window_manager_api_unittest.cc
@@ -67,7 +67,7 @@
   DISALLOW_COPY_AND_ASSIGN(TestWindowManagerObserver);
 };
 
-class TestApplicationLoader : public mojo::ApplicationLoader,
+class TestApplicationLoader : public mojo::shell::ApplicationLoader,
                               public mojo::ApplicationDelegate,
                               public mojo::ViewManagerDelegate {
  public:
@@ -78,7 +78,7 @@
   ~TestApplicationLoader() override {}
 
  private:
-  // Overridden from mojo::ApplicationLoader:
+  // Overridden from mojo::shell::ApplicationLoader:
   void Load(
       const GURL& url,
       mojo::InterfaceRequest<mojo::Application> application_request) override {
@@ -178,7 +178,7 @@
     test_helper_->AddURLMapping(GURL("mojo:window_manager"),
                                 GURL("mojo:core_window_manager"));
     test_helper_->SetLoaderForURL(
-        scoped_ptr<mojo::ApplicationLoader>(
+        scoped_ptr<mojo::shell::ApplicationLoader>(
             new TestApplicationLoader(base::Bind(
                 &WindowManagerApiTest::OnRootAdded, base::Unretained(this)))),
         GURL(kTestServiceURL));
diff --git a/shell/android/android_handler.cc b/shell/android/android_handler.cc
index 916d9f7..88b1cfd 100644
--- a/shell/android/android_handler.cc
+++ b/shell/android/android_handler.cc
@@ -23,6 +23,7 @@
 using base::android::GetApplicationContext;
 
 namespace mojo {
+namespace shell {
 
 namespace {
 
@@ -64,9 +65,8 @@
   }
 
   // Run the application.
-  base::ScopedNativeLibrary app_library_from_runner(
-      shell::LoadAndRunNativeApplication(app_path, NativeRunner::DeleteAppPath,
-                                         application_request.Pass()));
+  base::ScopedNativeLibrary app_library_from_runner(LoadAndRunNativeApplication(
+      app_path, NativeRunner::DeleteAppPath, application_request.Pass()));
 }
 
 }  // namespace
@@ -107,4 +107,5 @@
   return RegisterNativesImpl(env);
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/android/android_handler.h b/shell/android/android_handler.h
index c371647..1e1ad96 100644
--- a/shell/android/android_handler.h
+++ b/shell/android/android_handler.h
@@ -17,6 +17,7 @@
 }
 
 namespace mojo {
+namespace shell {
 
 class AndroidHandler : public ApplicationDelegate,
                        public ContentHandlerFactory::Delegate {
@@ -39,6 +40,7 @@
 
 bool RegisterAndroidHandlerJni(JNIEnv* env);
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java b/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
index cba1f7d..610ff16 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
@@ -22,7 +22,7 @@
  * TODO(ppi): create a seperate instance for each application being bootstrapped to keep track of
  * the temporary files and clean them up once the execution finishes.
  */
-@JNINamespace("mojo")
+@JNINamespace("mojo::shell")
 public class AndroidHandler {
     private static final String TAG = "AndroidHandler";
 
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/Bootstrap.java b/shell/android/apk/src/org/chromium/mojo/shell/Bootstrap.java
index b0a0719..9916c83 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/Bootstrap.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/Bootstrap.java
@@ -15,9 +15,8 @@
  * Java class with the application classloader in the call stack. We load this class in the
  * application classloader and call into native from it to achieve that.
  */
-@JNINamespace("mojo")
+@JNINamespace("mojo::shell")
 public class Bootstrap implements Runnable {
-
     private final Context mContext;
     private final File mBootstrapNativeLibrary;
     private final File mApplicationNativeLibrary;
diff --git a/shell/android/background_application_loader.cc b/shell/android/background_application_loader.cc
index 6260c2f..f35c45e 100644
--- a/shell/android/background_application_loader.cc
+++ b/shell/android/background_application_loader.cc
@@ -9,6 +9,7 @@
 #include "shell/application_manager/application_manager.h"
 
 namespace mojo {
+namespace shell {
 
 BackgroundApplicationLoader::BackgroundApplicationLoader(
     scoped_ptr<ApplicationLoader> real_loader,
@@ -68,4 +69,5 @@
   loader_->Load(url, application_request.Pass());
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/android/background_application_loader.h b/shell/android/background_application_loader.h
index 8baacbb..9dcee40 100644
--- a/shell/android/background_application_loader.h
+++ b/shell/android/background_application_loader.h
@@ -13,6 +13,7 @@
 #include "shell/application_manager/application_loader.h"
 
 namespace mojo {
+namespace shell {
 
 class BackgroundApplicationLoader
     : public ApplicationLoader,
@@ -57,6 +58,7 @@
   DISALLOW_COPY_AND_ASSIGN(BackgroundApplicationLoader);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_ANDROID_BACKGROUND_APPLICATION_LOADER_H_
diff --git a/shell/android/background_application_loader_unittest.cc b/shell/android/background_application_loader_unittest.cc
index bf8873d..e07d79d 100644
--- a/shell/android/background_application_loader_unittest.cc
+++ b/shell/android/background_application_loader_unittest.cc
@@ -8,7 +8,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
-
+namespace shell {
 namespace {
 
 class DummyLoader : public ApplicationLoader {
@@ -29,8 +29,6 @@
   bool simulate_app_quit_;
 };
 
-}  // namespace
-
 // Tests that the loader can start and stop gracefully.
 TEST(BackgroundApplicationLoaderTest, StartStop) {
   scoped_ptr<ApplicationLoader> real_loader(new DummyLoader());
@@ -48,4 +46,6 @@
   loader.Load(GURL(), GetProxy(&application));
 }
 
+}  // namespace
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/android/bootstrap.cc b/shell/android/bootstrap.cc
index 823258c..a1c4573 100644
--- a/shell/android/bootstrap.cc
+++ b/shell/android/bootstrap.cc
@@ -10,6 +10,7 @@
 #include "shell/android/run_android_application_function.h"
 
 namespace mojo {
+namespace shell {
 
 void Bootstrap(JNIEnv* env,
                jobject,
@@ -28,13 +29,14 @@
   return RegisterNativesImpl(env);
 }
 
+}  // namespace shell
 }  // namespace mojo
 
 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
   base::android::InitVM(vm);
   JNIEnv* env = base::android::AttachCurrentThread();
 
-  if (!mojo::RegisterBootstrapJni(env))
+  if (!mojo::shell::RegisterBootstrapJni(env))
     return -1;
 
   return JNI_VERSION_1_4;
diff --git a/shell/android/library_loader.cc b/shell/android/library_loader.cc
index 0aff50b..b0992c1 100644
--- a/shell/android/library_loader.cc
+++ b/shell/android/library_loader.cc
@@ -15,7 +15,7 @@
 namespace {
 
 base::android::RegistrationMethod kMojoRegisteredMethods[] = {
-    {"AndroidHandler", mojo::RegisterAndroidHandlerJni},
+    {"AndroidHandler", mojo::shell::RegisterAndroidHandlerJni},
     {"Keyboard", mojo::shell::RegisterKeyboardJni},
     {"MojoMain", mojo::shell::RegisterMojoMain},
     {"PlatformViewportAndroid",
diff --git a/shell/android/run_android_application_function.h b/shell/android/run_android_application_function.h
index 490d724..3ed1744 100644
--- a/shell/android/run_android_application_function.h
+++ b/shell/android/run_android_application_function.h
@@ -8,16 +8,20 @@
 #include "base/android/jni_android.h"
 #include "base/files/file_path.h"
 
+namespace mojo {
+namespace shell {
+
 // Type of the function that we inject from the main .so of the Mojo shell to
 // the helper libbootstrap.so. This function will set the thunks in the
 // application .so and call into application MojoMain. Injecting the function
 // from the main .so ensures that the thunks are set correctly.
 
-namespace mojo {
 typedef void (*RunAndroidApplicationFn)(JNIEnv* env,
                                         jobject j_context,
                                         const base::FilePath& app_path,
                                         jint j_handle);
-}
+
+}  // namespace shell
+}  // namespace mojo
 
 #endif  // SHELL_ANDROID_RUN_ANDROID_APPLICATION_FUNCTION_H_
diff --git a/shell/android/ui_application_loader_android.cc b/shell/android/ui_application_loader_android.cc
index dbce95b..acd3185 100644
--- a/shell/android/ui_application_loader_android.cc
+++ b/shell/android/ui_application_loader_android.cc
@@ -9,6 +9,7 @@
 #include "shell/application_manager/application_manager.h"
 
 namespace mojo {
+namespace shell {
 
 UIApplicationLoader::UIApplicationLoader(
     scoped_ptr<ApplicationLoader> real_loader,
@@ -43,4 +44,5 @@
   loader_.reset();
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/android/ui_application_loader_android.h b/shell/android/ui_application_loader_android.h
index 1730a35..3e785bb 100644
--- a/shell/android/ui_application_loader_android.h
+++ b/shell/android/ui_application_loader_android.h
@@ -14,6 +14,7 @@
 }
 
 namespace mojo {
+namespace shell {
 
 class ApplicationManager;
 
@@ -47,6 +48,7 @@
   DISALLOW_COPY_AND_ASSIGN(UIApplicationLoader);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_
diff --git a/shell/application_manager/application_loader.h b/shell/application_manager/application_loader.h
index 95a1b78..11feb38 100644
--- a/shell/application_manager/application_loader.h
+++ b/shell/application_manager/application_loader.h
@@ -14,6 +14,9 @@
 namespace mojo {
 
 class Application;
+
+namespace shell {
+
 class ApplicationManager;
 
 // Interface to implement special application loading behavior for a particular
@@ -29,6 +32,7 @@
   ApplicationLoader() {}
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_
diff --git a/shell/application_manager/application_manager.cc b/shell/application_manager/application_manager.cc
index 145e4a1..5f9c5f1 100644
--- a/shell/application_manager/application_manager.cc
+++ b/shell/application_manager/application_manager.cc
@@ -4,8 +4,6 @@
 
 #include "shell/application_manager/application_manager.h"
 
-#include <stdio.h>
-
 #include "base/bind.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
@@ -21,6 +19,7 @@
 #include "shell/application_manager/network_fetcher.h"
 
 namespace mojo {
+namespace shell {
 
 namespace {
 
@@ -365,7 +364,7 @@
     const GURL& content_handler_url,
     InterfaceRequest<Application> application_request,
     URLResponsePtr url_response) {
-  ContentHandlerConnection* connection = NULL;
+  ContentHandlerConnection* connection = nullptr;
   URLToContentHandlerMap::iterator iter =
       url_to_content_handler_.find(content_handler_url);
   if (iter != url_to_content_handler_.end()) {
@@ -420,7 +419,7 @@
   auto scheme_it = scheme_to_loader_.find(url.scheme());
   if (scheme_it != scheme_to_loader_.end())
     return scheme_it->second;
-  return NULL;
+  return nullptr;
 }
 
 void ApplicationManager::OnShellImplError(ShellImpl* shell_impl) {
@@ -467,4 +466,5 @@
       std::find(native_runners_.begin(), native_runners_.end(), runner));
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/application_manager.h b/shell/application_manager/application_manager.h
index 844be55..52b0ec6 100644
--- a/shell/application_manager/application_manager.h
+++ b/shell/application_manager/application_manager.h
@@ -27,6 +27,7 @@
 }
 
 namespace mojo {
+namespace shell {
 
 // ApplicationManager requires implementations of NativeRunner and
 // NativeRunnerFactory to run native applications.
@@ -260,6 +261,7 @@
   DISALLOW_COPY_AND_ASSIGN(ApplicationManager);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
diff --git a/shell/application_manager/application_manager_unittest.cc b/shell/application_manager/application_manager_unittest.cc
index 3d8b872..1683ab8 100644
--- a/shell/application_manager/application_manager_unittest.cc
+++ b/shell/application_manager/application_manager_unittest.cc
@@ -19,6 +19,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
+namespace shell {
 namespace {
 
 const char kTestURLString[] = "test:testService";
@@ -62,7 +63,7 @@
 
   // TestService implementation:
   void Test(const String& test_string,
-            const mojo::Callback<void()>& callback) override {
+            const Callback<void()>& callback) override {
     context_->last_test_string = test_string;
     callback.Run();
   }
@@ -284,12 +285,12 @@
   }
 
  private:
-  void B(const mojo::Callback<void()>& callback) override {
+  void B(const Callback<void()>& callback) override {
     test_context_->IncrementNumBCalls();
     callback.Run();
   }
 
-  void CallC(const mojo::Callback<void()>& callback) override {
+  void CallC(const Callback<void()>& callback) override {
     test_context_->IncrementNumBCalls();
     c_->C(callback);
   }
@@ -309,7 +310,7 @@
   ~TestCImpl() override { test_context_->IncrementNumCDeletes(); }
 
  private:
-  void C(const mojo::Callback<void()>& callback) override {
+  void C(const Callback<void()>& callback) override {
     test_context_->IncrementNumCCalls();
     callback.Run();
   }
@@ -436,8 +437,6 @@
   bool configure_incoming_connection_called_;
 };
 
-}  // namespace
-
 class ApplicationManagerTest : public testing::Test {
  public:
   ApplicationManagerTest() : tester_context_(&loop_) {}
@@ -755,4 +754,6 @@
   EXPECT_EQ(1, scheme_loader->num_loads());
 }
 
+}  // namespace
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/fetcher.cc b/shell/application_manager/fetcher.cc
index 5637746..1184ef1 100644
--- a/shell/application_manager/fetcher.cc
+++ b/shell/application_manager/fetcher.cc
@@ -7,6 +7,7 @@
 #include "url/gurl.h"
 
 namespace mojo {
+namespace shell {
 
 const char Fetcher::kMojoMagic[] = "#!mojo ";
 const size_t Fetcher::kMaxShebangLength = 2048;
@@ -33,4 +34,5 @@
   return false;
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/fetcher.h b/shell/application_manager/fetcher.h
index b9e9de5..23519cb 100644
--- a/shell/application_manager/fetcher.h
+++ b/shell/application_manager/fetcher.h
@@ -13,12 +13,12 @@
 class GURL;
 
 namespace base {
-
 class FilePath;
 class TaskRunner;
 }
 
 namespace mojo {
+namespace shell {
 
 // Fetcher abstracts getting an application by either file or http[s] URL.
 //
@@ -70,6 +70,7 @@
   FetchCallback loader_callback_;
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_APPLICATION_MANAGER_FETCHER_H_
diff --git a/shell/application_manager/local_fetcher.cc b/shell/application_manager/local_fetcher.cc
index 62271a9..88339b0 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -15,6 +15,7 @@
 #include "url/url_util.h"
 
 namespace mojo {
+namespace shell {
 
 namespace {
 
@@ -99,4 +100,5 @@
   return true;
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/local_fetcher.h b/shell/application_manager/local_fetcher.h
index 8701e9d..19ace2d 100644
--- a/shell/application_manager/local_fetcher.h
+++ b/shell/application_manager/local_fetcher.h
@@ -11,6 +11,7 @@
 #include "url/gurl.h"
 
 namespace mojo {
+namespace shell {
 
 // Implements Fetcher for file:// URLs.
 class LocalFetcher : public Fetcher {
@@ -44,6 +45,7 @@
   DISALLOW_COPY_AND_ASSIGN(LocalFetcher);
 };
 
-#endif  // SHELL_APPLICATION_MANAGER_LOCAL_FETCHER_H_
-
+}  // namespace shell
 }  // namespace mojo
+
+#endif  // SHELL_APPLICATION_MANAGER_LOCAL_FETCHER_H_
diff --git a/shell/application_manager/network_fetcher.cc b/shell/application_manager/network_fetcher.cc
index 01bdc3e..8ebcf3e 100644
--- a/shell/application_manager/network_fetcher.cc
+++ b/shell/application_manager/network_fetcher.cc
@@ -22,6 +22,7 @@
 #include "shell/application_manager/data_pipe_peek.h"
 
 namespace mojo {
+namespace shell {
 
 NetworkFetcher::NetworkFetcher(bool disable_cache,
                                const GURL& url,
@@ -167,14 +168,14 @@
 
 bool NetworkFetcher::HasMojoMagic() {
   std::string magic;
-  return shell::BlockingPeekNBytes(response_->body.get(), &magic,
-                                   strlen(kMojoMagic), kPeekTimeout) &&
+  return BlockingPeekNBytes(response_->body.get(), &magic, strlen(kMojoMagic),
+                            kPeekTimeout) &&
          magic == kMojoMagic;
 }
 
 bool NetworkFetcher::PeekFirstLine(std::string* line) {
-  return shell::BlockingPeekLine(response_->body.get(), line, kMaxShebangLength,
-                                 kPeekTimeout);
+  return BlockingPeekLine(response_->body.get(), line, kMaxShebangLength,
+                          kPeekTimeout);
 }
 
 void NetworkFetcher::StartNetworkRequest(const GURL& url,
@@ -211,4 +212,5 @@
   loader_callback_.Run(make_scoped_ptr(this));
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/network_fetcher.h b/shell/application_manager/network_fetcher.h
index d1d812e..ff41527 100644
--- a/shell/application_manager/network_fetcher.h
+++ b/shell/application_manager/network_fetcher.h
@@ -16,6 +16,8 @@
 
 class NetworkService;
 
+namespace shell {
+
 // Implements Fetcher for http[s] files.
 class NetworkFetcher : public Fetcher {
  public:
@@ -74,6 +76,7 @@
   DISALLOW_COPY_AND_ASSIGN(NetworkFetcher);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_
diff --git a/shell/application_manager/shell_impl.cc b/shell/application_manager/shell_impl.cc
index 677e84e..289b19b 100644
--- a/shell/application_manager/shell_impl.cc
+++ b/shell/application_manager/shell_impl.cc
@@ -9,6 +9,7 @@
 #include "shell/application_manager/application_manager.h"
 
 namespace mojo {
+namespace shell {
 
 ShellImpl::ShellImpl(ApplicationPtr application,
                      ApplicationManager* manager,
@@ -56,4 +57,5 @@
   manager_->OnShellImplError(this);
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/application_manager/shell_impl.h b/shell/application_manager/shell_impl.h
index 5b44e9a..5f405e5 100644
--- a/shell/application_manager/shell_impl.h
+++ b/shell/application_manager/shell_impl.h
@@ -12,6 +12,8 @@
 #include "url/gurl.h"
 
 namespace mojo {
+namespace shell {
+
 class ApplicationManager;
 
 class ShellImpl : public Shell, public ErrorHandler {
@@ -53,6 +55,7 @@
   DISALLOW_COPY_AND_ASSIGN(ShellImpl);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_
diff --git a/shell/application_manager/test.mojom b/shell/application_manager/test.mojom
index 56886e1..25700b5 100644
--- a/shell/application_manager/test.mojom
+++ b/shell/application_manager/test.mojom
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-module mojo;
+module mojo.shell;
 
 interface TestService {
   Test(string test_string) => ();
diff --git a/shell/context.h b/shell/context.h
index b3f2510..645764d 100644
--- a/shell/context.h
+++ b/shell/context.h
@@ -14,7 +14,6 @@
 #include "shell/url_resolver.h"
 
 namespace mojo {
-
 namespace shell {
 
 class ExternalApplicationListener;
diff --git a/shell/filename_util.cc b/shell/filename_util.cc
index 8c1e8ae..c1b901c 100644
--- a/shell/filename_util.cc
+++ b/shell/filename_util.cc
@@ -12,6 +12,7 @@
 #include "url/url_util.h"
 
 namespace mojo {
+namespace shell {
 
 // Prefix to prepend to get a file URL.
 static const base::FilePath::CharType kFileURLPrefix[] =
@@ -67,4 +68,5 @@
   return url.ReplaceComponents(replacements);
 }
 
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/filename_util.h b/shell/filename_util.h
index 4dae84a..28d0e78 100644
--- a/shell/filename_util.h
+++ b/shell/filename_util.h
@@ -12,6 +12,7 @@
 }
 
 namespace mojo {
+namespace shell {
 
 // Given the full path to a file name, creates a file: URL. The returned URL
 // may not be valid if the input is malformed.
@@ -21,6 +22,7 @@
 // slash so that GURL.Resolve(...) works correctly.
 GURL AddTrailingSlashIfNeeded(const GURL& url);
 
+}  // namespace shell
 }  // namespace mojo
 
 #endif  // SHELL_FILENAME_UTIL_H_
diff --git a/shell/launcher_main.cc b/shell/launcher_main.cc
index 206dd67..410417b 100644
--- a/shell/launcher_main.cc
+++ b/shell/launcher_main.cc
@@ -22,6 +22,7 @@
 #include "url/gurl.h"
 
 namespace mojo {
+namespace shell {
 
 const char kAppArgs[] = "app-args";
 const char kAppPath[] = "app-path";
@@ -34,7 +35,7 @@
       : app_path_(command_line.GetSwitchValuePath(kAppPath)),
         app_url_(command_line.GetSwitchValueASCII(kAppURL)),
         loop_(base::MessageLoop::TYPE_IO),
-        connection_(new shell::ExternalApplicationRegistrarConnection(
+        connection_(new ExternalApplicationRegistrarConnection(
             base::FilePath(command_line.GetSwitchValuePath(kShellPath)))) {
     // TODO(vtl): I guess this should be SLAVE, not NONE?
     embedder::InitIPCSupport(embedder::ProcessType::NONE, loop_.task_runner(),
@@ -71,7 +72,7 @@
 
   void Run() {
     DCHECK(application_request_.is_pending());
-    shell::InProcessNativeRunner service_runner(nullptr);
+    InProcessNativeRunner service_runner(nullptr);
     base::RunLoop run_loop;
     service_runner.Start(app_path_, NativeRunner::DontDeleteAppPath,
                          application_request_.Pass(), run_loop.QuitClosure());
@@ -94,12 +95,13 @@
   const GURL app_url_;
   std::vector<std::string> app_args_;
   base::MessageLoop loop_;
-  scoped_ptr<shell::ExternalApplicationRegistrarConnection> connection_;
+  scoped_ptr<ExternalApplicationRegistrarConnection> connection_;
   InterfaceRequest<Application> application_request_;
 
   DISALLOW_COPY_AND_ASSIGN(Launcher);
 };
 
+}  // namespace shell
 }  // namespace mojo
 
 int main(int argc, char** argv) {
@@ -112,16 +114,16 @@
       base::CommandLine::ForCurrentProcess();
   mojo::shell::InitializeLogging();
 
-  mojo::Launcher launcher(*command_line);
+  mojo::shell::Launcher launcher(*command_line);
   if (!launcher.Connect()) {
     LOG(ERROR) << "Failed to connect on socket "
-               << command_line->GetSwitchValueASCII(mojo::kShellPath);
+               << command_line->GetSwitchValueASCII(mojo::shell::kShellPath);
     return 1;
   }
 
   if (!launcher.Register()) {
     LOG(ERROR) << "Error registering "
-               << command_line->GetSwitchValueASCII(mojo::kAppURL);
+               << command_line->GetSwitchValueASCII(mojo::shell::kAppURL);
     return 1;
   }
 
diff --git a/shell/native_runner_unittest.cc b/shell/native_runner_unittest.cc
index b9c5776..7faee04 100644
--- a/shell/native_runner_unittest.cc
+++ b/shell/native_runner_unittest.cc
@@ -9,6 +9,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
+namespace shell {
 namespace {
 
 struct TestState {
@@ -99,4 +100,5 @@
 }
 
 }  // namespace
+}  // namespace shell
 }  // namespace mojo
diff --git a/shell/shell_test_helper.h b/shell/shell_test_helper.h
index 92455ec..325ddac 100644
--- a/shell/shell_test_helper.h
+++ b/shell/shell_test_helper.h
@@ -14,7 +14,6 @@
 class GURL;
 
 namespace mojo {
-
 namespace shell {
 
 // ShellTestHelper is useful for tests to establish a connection to the