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/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) => ();