Add some |using mojo::...;|s to //shell .cc files.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1074963002
diff --git a/shell/android/native_viewport_application_loader.cc b/shell/android/native_viewport_application_loader.cc
index 82d0ca2..295fce6 100644
--- a/shell/android/native_viewport_application_loader.cc
+++ b/shell/android/native_viewport_application_loader.cc
@@ -9,6 +9,9 @@
 #include "services/native_viewport/native_viewport_impl.h"
 #include "shell/android/keyboard_impl.h"
 
+using mojo::ApplicationConnection;
+using mojo::InterfaceRequest;
+
 namespace shell {
 
 NativeViewportApplicationLoader::NativeViewportApplicationLoader() {
@@ -19,13 +22,13 @@
 
 void NativeViewportApplicationLoader::Load(
     const GURL& url,
-    mojo::InterfaceRequest<mojo::Application> application_request) {
+    InterfaceRequest<mojo::Application> application_request) {
   DCHECK(application_request.is_pending());
   app_.reset(new mojo::ApplicationImpl(this, application_request.Pass()));
 }
 
 bool NativeViewportApplicationLoader::ConfigureIncomingConnection(
-    mojo::ApplicationConnection* connection) {
+    ApplicationConnection* connection) {
   connection->AddService<mojo::NativeViewport>(this);
   connection->AddService<mojo::Gpu>(this);
   connection->AddService<mojo::Keyboard>(this);
@@ -33,22 +36,22 @@
 }
 
 void NativeViewportApplicationLoader::Create(
-    mojo::ApplicationConnection* connection,
-    mojo::InterfaceRequest<mojo::NativeViewport> request) {
+    ApplicationConnection* connection,
+    InterfaceRequest<mojo::NativeViewport> request) {
   if (!gpu_state_)
     gpu_state_ = new gles2::GpuState;
   new native_viewport::NativeViewportImpl(false, gpu_state_, request.Pass());
 }
 
 void NativeViewportApplicationLoader::Create(
-    mojo::ApplicationConnection* connection,
-    mojo::InterfaceRequest<mojo::Keyboard> request) {
+    ApplicationConnection* connection,
+    InterfaceRequest<mojo::Keyboard> request) {
   new KeyboardImpl(request.Pass());
 }
 
 void NativeViewportApplicationLoader::Create(
-    mojo::ApplicationConnection* connection,
-    mojo::InterfaceRequest<mojo::Gpu> request) {
+    ApplicationConnection* connection,
+    InterfaceRequest<mojo::Gpu> request) {
   if (!gpu_state_)
     gpu_state_ = new gles2::GpuState;
   new gles2::GpuImpl(request.Pass(), gpu_state_);
diff --git a/shell/application_manager/application_manager.cc b/shell/application_manager/application_manager.cc
index e9ae018..85a6f32 100644
--- a/shell/application_manager/application_manager.cc
+++ b/shell/application_manager/application_manager.cc
@@ -21,6 +21,12 @@
 #include "shell/application_manager/shell_impl.h"
 #include "shell/switches.h"
 
+using mojo::Application;
+using mojo::ApplicationPtr;
+using mojo::InterfaceRequest;
+using mojo::ServiceProvider;
+using mojo::ServiceProviderPtr;
+
 namespace shell {
 
 namespace {
@@ -57,7 +63,7 @@
   ContentHandlerConnection(ApplicationManager* manager,
                            const GURL& content_handler_url)
       : manager_(manager), content_handler_url_(content_handler_url) {
-    mojo::ServiceProviderPtr services;
+    ServiceProviderPtr services;
     manager->ConnectToApplication(content_handler_url, GURL(),
                                   mojo::GetProxy(&services), nullptr,
                                   base::Closure());
@@ -118,8 +124,8 @@
 void ApplicationManager::ConnectToApplication(
     const GURL& requested_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services,
+    InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services,
     const base::Closure& on_application_end) {
   ConnectToApplicationWithParameters(
       requested_url, requestor_url, services.Pass(), exposed_services.Pass(),
@@ -129,8 +135,8 @@
 void ApplicationManager::ConnectToApplicationWithParameters(
     const GURL& requested_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services,
+    InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services,
     const base::Closure& on_application_end,
     const std::vector<std::string>& pre_redirect_parameters) {
   TRACE_EVENT_INSTANT1(
@@ -204,8 +210,8 @@
 bool ApplicationManager::ConnectToRunningApplication(
     const GURL& resolved_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider>* services,
-    mojo::ServiceProviderPtr* exposed_services) {
+    InterfaceRequest<ServiceProvider>* services,
+    ServiceProviderPtr* exposed_services) {
   GURL application_url = GetBaseURLAndQuery(resolved_url, nullptr);
   ShellImpl* shell_impl = GetShellImpl(application_url);
   if (!shell_impl)
@@ -219,8 +225,8 @@
 bool ApplicationManager::ConnectToApplicationWithLoader(
     const GURL& resolved_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider>* services,
-    mojo::ServiceProviderPtr* exposed_services,
+    InterfaceRequest<ServiceProvider>* services,
+    ServiceProviderPtr* exposed_services,
     const base::Closure& on_application_end,
     const std::vector<std::string>& parameters,
     ApplicationLoader* loader) {
@@ -234,17 +240,17 @@
   return true;
 }
 
-mojo::InterfaceRequest<mojo::Application> ApplicationManager::RegisterShell(
+InterfaceRequest<Application> ApplicationManager::RegisterShell(
     const GURL& resolved_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services,
+    InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services,
     const base::Closure& on_application_end,
     const std::vector<std::string>& parameters) {
   Identity app_identity(resolved_url);
 
   mojo::ApplicationPtr application;
-  mojo::InterfaceRequest<mojo::Application> application_request =
+  InterfaceRequest<Application> application_request =
       mojo::GetProxy(&application);
   ShellImpl* shell =
       new ShellImpl(application.Pass(), this, app_identity, on_application_end);
@@ -266,16 +272,16 @@
     ShellImpl* shell_impl,
     const GURL& resolved_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services) {
+    InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services) {
   shell_impl->ConnectToClient(resolved_url, requestor_url, services.Pass(),
                               exposed_services.Pass());
 }
 
 void ApplicationManager::HandleFetchCallback(
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services,
+    InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services,
     const base::Closure& on_application_end,
     const std::vector<std::string>& parameters,
     NativeApplicationCleanup cleanup,
@@ -305,7 +311,7 @@
     return;
   }
 
-  mojo::InterfaceRequest<mojo::Application> request(
+  InterfaceRequest<Application> request(
       RegisterShell(fetcher->GetURL(), requestor_url, services.Pass(),
                     exposed_services.Pass(), on_application_end, parameters));
 
@@ -350,7 +356,7 @@
 }
 
 void ApplicationManager::RunNativeApplication(
-    mojo::InterfaceRequest<mojo::Application> application_request,
+    InterfaceRequest<Application> application_request,
     const NativeRunnerFactory::Options& options,
     NativeApplicationCleanup cleanup,
     scoped_ptr<Fetcher> fetcher,
@@ -386,7 +392,7 @@
 
 void ApplicationManager::LoadWithContentHandler(
     const GURL& content_handler_url,
-    mojo::InterfaceRequest<mojo::Application> application_request,
+    InterfaceRequest<Application> application_request,
     mojo::URLResponsePtr url_response) {
   ContentHandlerConnection* connection = nullptr;
   URLToContentHandlerMap::iterator iter =
@@ -484,7 +490,7 @@
 mojo::ScopedMessagePipeHandle ApplicationManager::ConnectToServiceByName(
     const GURL& application_url,
     const std::string& interface_name) {
-  mojo::ServiceProviderPtr services;
+  ServiceProviderPtr services;
   ConnectToApplication(application_url, GURL(), mojo::GetProxy(&services),
                        nullptr, base::Closure());
   mojo::MessagePipe pipe;
diff --git a/shell/application_manager/application_manager_unittest.cc b/shell/application_manager/application_manager_unittest.cc
index 099728f..25c373a 100644
--- a/shell/application_manager/application_manager_unittest.cc
+++ b/shell/application_manager/application_manager_unittest.cc
@@ -18,6 +18,15 @@
 #include "shell/application_manager/test.mojom.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using mojo::Application;
+using mojo::ApplicationConnection;
+using mojo::ApplicationDelegate;
+using mojo::ApplicationImpl;
+using mojo::Callback;
+using mojo::InterfaceFactory;
+using mojo::InterfaceRequest;
+using mojo::StrongBinding;
+
 namespace shell {
 namespace {
 
@@ -53,8 +62,7 @@
 
 class TestServiceImpl : public TestService {
  public:
-  TestServiceImpl(TestContext* context,
-                  mojo::InterfaceRequest<TestService> request)
+  TestServiceImpl(TestContext* context, InterfaceRequest<TestService> request)
       : context_(context), binding_(this, request.Pass()) {
     ++context_->num_impls;
   }
@@ -68,14 +76,14 @@
 
   // TestService implementation:
   void Test(const mojo::String& test_string,
-            const mojo::Callback<void()>& callback) override {
+            const Callback<void()>& callback) override {
     context_->last_test_string = test_string;
     callback.Run();
   }
 
  private:
   TestContext* context_;
-  mojo::StrongBinding<TestService> binding_;
+  StrongBinding<TestService> binding_;
 };
 
 class TestClient {
@@ -101,8 +109,8 @@
 };
 
 class TestApplicationLoader : public ApplicationLoader,
-                              public mojo::ApplicationDelegate,
-                              public mojo::InterfaceFactory<TestService> {
+                              public ApplicationDelegate,
+                              public InterfaceFactory<TestService> {
  public:
   TestApplicationLoader() : context_(nullptr), num_loads_(0) {}
 
@@ -118,28 +126,25 @@
 
  private:
   // ApplicationLoader implementation.
-  void Load(
-      const GURL& url,
-      mojo::InterfaceRequest<mojo::Application> application_request) override {
+  void Load(const GURL& url,
+            InterfaceRequest<Application> application_request) override {
     ++num_loads_;
-    test_app_.reset(
-        new mojo::ApplicationImpl(this, application_request.Pass()));
+    test_app_.reset(new ApplicationImpl(this, application_request.Pass()));
   }
 
-  // mojo::ApplicationDelegate implementation.
-  bool ConfigureIncomingConnection(
-      mojo::ApplicationConnection* connection) override {
+  // ApplicationDelegate implementation.
+  bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
     connection->AddService(this);
     return true;
   }
 
-  // mojo::InterfaceFactory implementation.
-  void Create(mojo::ApplicationConnection* connection,
-              mojo::InterfaceRequest<TestService> request) override {
+  // InterfaceFactory implementation.
+  void Create(ApplicationConnection* connection,
+              InterfaceRequest<TestService> request) override {
     new TestServiceImpl(context_, request.Pass());
   }
 
-  scoped_ptr<mojo::ApplicationImpl> test_app_;
+  scoped_ptr<ApplicationImpl> test_app_;
   TestContext* context_;
   int num_loads_;
   DISALLOW_COPY_AND_ASSIGN(TestApplicationLoader);
@@ -148,9 +153,8 @@
 class ClosingApplicationLoader : public ApplicationLoader {
  private:
   // ApplicationLoader implementation.
-  void Load(
-      const GURL& url,
-      mojo::InterfaceRequest<mojo::Application> application_request) override {}
+  void Load(const GURL& url,
+            InterfaceRequest<Application> application_request) override {}
 };
 
 class TesterContext {
@@ -251,9 +255,9 @@
 // Used to test that the requestor url will be correctly passed.
 class TestAImpl : public TestA {
  public:
-  TestAImpl(mojo::ApplicationImpl* app_impl,
+  TestAImpl(ApplicationImpl* app_impl,
             TesterContext* test_context,
-            mojo::InterfaceRequest<TestA> request)
+            InterfaceRequest<TestA> request)
       : test_context_(test_context), binding_(this, request.Pass()) {
     app_impl->ConnectToApplication(kTestBURLString)->ConnectToService(&b_);
   }
@@ -281,14 +285,14 @@
 
   TesterContext* test_context_;
   TestBPtr b_;
-  mojo::StrongBinding<TestA> binding_;
+  StrongBinding<TestA> binding_;
 };
 
 class TestBImpl : public TestB {
  public:
-  TestBImpl(mojo::ApplicationConnection* connection,
+  TestBImpl(ApplicationConnection* connection,
             TesterContext* test_context,
-            mojo::InterfaceRequest<TestB> request)
+            InterfaceRequest<TestB> request)
       : test_context_(test_context), binding_(this, request.Pass()) {
     connection->ConnectToService(&c_);
   }
@@ -301,59 +305,57 @@
   }
 
  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);
   }
 
   TesterContext* test_context_;
   TestCPtr c_;
-  mojo::StrongBinding<TestB> binding_;
+  StrongBinding<TestB> binding_;
 };
 
 class TestCImpl : public TestC {
  public:
-  TestCImpl(mojo::ApplicationConnection* connection,
+  TestCImpl(ApplicationConnection* connection,
             TesterContext* test_context,
-            mojo::InterfaceRequest<TestC> request)
+            InterfaceRequest<TestC> request)
       : test_context_(test_context), binding_(this, request.Pass()) {}
 
   ~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();
   }
 
   TesterContext* test_context_;
-  mojo::StrongBinding<TestC> binding_;
+  StrongBinding<TestC> binding_;
 };
 
-class Tester : public mojo::ApplicationDelegate,
+class Tester : public ApplicationDelegate,
                public ApplicationLoader,
-               public mojo::InterfaceFactory<TestA>,
-               public mojo::InterfaceFactory<TestB>,
-               public mojo::InterfaceFactory<TestC> {
+               public InterfaceFactory<TestA>,
+               public InterfaceFactory<TestB>,
+               public InterfaceFactory<TestC> {
  public:
   Tester(TesterContext* context, const std::string& requestor_url)
       : context_(context), requestor_url_(requestor_url) {}
   ~Tester() override {}
 
  private:
-  void Load(
-      const GURL& url,
-      mojo::InterfaceRequest<mojo::Application> application_request) override {
-    app_.reset(new mojo::ApplicationImpl(this, application_request.Pass()));
+  void Load(const GURL& url,
+            InterfaceRequest<Application> application_request) override {
+    app_.reset(new ApplicationImpl(this, application_request.Pass()));
   }
 
-  bool ConfigureIncomingConnection(
-      mojo::ApplicationConnection* connection) override {
+  bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
     if (!requestor_url_.empty() &&
         requestor_url_ != connection->GetRemoteApplicationURL()) {
       context_->set_tester_called_quit();
@@ -369,31 +371,30 @@
     return true;
   }
 
-  bool ConfigureOutgoingConnection(
-      mojo::ApplicationConnection* connection) override {
+  bool ConfigureOutgoingConnection(ApplicationConnection* connection) override {
     // If we're connecting to B, then add C.
     if (connection->GetRemoteApplicationURL() == kTestBURLString)
       connection->AddService<TestC>(this);
     return true;
   }
 
-  void Create(mojo::ApplicationConnection* connection,
-              mojo::InterfaceRequest<TestA> request) override {
+  void Create(ApplicationConnection* connection,
+              InterfaceRequest<TestA> request) override {
     a_bindings_.push_back(new TestAImpl(app_.get(), context_, request.Pass()));
   }
 
-  void Create(mojo::ApplicationConnection* connection,
-              mojo::InterfaceRequest<TestB> request) override {
+  void Create(ApplicationConnection* connection,
+              InterfaceRequest<TestB> request) override {
     new TestBImpl(connection, context_, request.Pass());
   }
 
-  void Create(mojo::ApplicationConnection* connection,
-              mojo::InterfaceRequest<TestC> request) override {
+  void Create(ApplicationConnection* connection,
+              InterfaceRequest<TestC> request) override {
     new TestCImpl(connection, context_, request.Pass());
   }
 
   TesterContext* context_;
-  scoped_ptr<mojo::ApplicationImpl> app_;
+  scoped_ptr<ApplicationImpl> app_;
   std::string requestor_url_;
   ScopedVector<TestAImpl> a_bindings_;
 };
@@ -426,17 +427,16 @@
   std::map<GURL, GURL> mappings_;
 };
 
-class TestExternal : public mojo::ApplicationDelegate {
+class TestExternal : public ApplicationDelegate {
  public:
   TestExternal() : configure_incoming_connection_called_(false) {}
 
-  void Initialize(mojo::ApplicationImpl* app) override {
+  void Initialize(ApplicationImpl* app) override {
     initialize_args_ = app->args();
     base::MessageLoop::current()->Quit();
   }
 
-  bool ConfigureIncomingConnection(
-      mojo::ApplicationConnection* connection) override {
+  bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
     configure_incoming_connection_called_ = true;
     base::MessageLoop::current()->Quit();
     return true;
diff --git a/shell/application_manager/shell_impl.cc b/shell/application_manager/shell_impl.cc
index 1c0d533..0384ed7 100644
--- a/shell/application_manager/shell_impl.cc
+++ b/shell/application_manager/shell_impl.cc
@@ -8,6 +8,9 @@
 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
 #include "shell/application_manager/application_manager.h"
 
+using mojo::ServiceProvider;
+using mojo::ServiceProviderPtr;
+
 namespace shell {
 
 ShellImpl::ShellImpl(mojo::ApplicationPtr application,
@@ -34,8 +37,8 @@
 void ShellImpl::ConnectToClient(
     const GURL& requested_url,
     const GURL& requestor_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services) {
+    mojo::InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services) {
   application_->AcceptConnection(mojo::String::From(requestor_url),
                                  services.Pass(), exposed_services.Pass(),
                                  requested_url.spec());
@@ -44,8 +47,8 @@
 // Shell implementation:
 void ShellImpl::ConnectToApplication(
     const mojo::String& app_url,
-    mojo::InterfaceRequest<mojo::ServiceProvider> services,
-    mojo::ServiceProviderPtr exposed_services) {
+    mojo::InterfaceRequest<ServiceProvider> services,
+    ServiceProviderPtr exposed_services) {
   GURL app_gurl(app_url);
   if (!app_gurl.is_valid()) {
     LOG(ERROR) << "Error: invalid URL: " << app_url;
diff --git a/shell/context.cc b/shell/context.cc
index 7261d54..28ce235 100644
--- a/shell/context.cc
+++ b/shell/context.cc
@@ -38,6 +38,9 @@
 #include "shell/switches.h"
 #include "url/gurl.h"
 
+using mojo::ServiceProvider;
+using mojo::ServiceProviderPtr;
+
 namespace shell {
 namespace {
 
@@ -171,10 +174,10 @@
   }
 }
 
-class TracingServiceProvider : public mojo::ServiceProvider {
+class TracingServiceProvider : public ServiceProvider {
  public:
   explicit TracingServiceProvider(
-      mojo::InterfaceRequest<mojo::ServiceProvider> request)
+      mojo::InterfaceRequest<ServiceProvider> request)
       : binding_(this, request.Pass()) {}
   ~TracingServiceProvider() override {}
 
@@ -285,7 +288,7 @@
   InitContentHandlers(&application_manager_, command_line);
   InitNativeOptions(&application_manager_, command_line);
 
-  mojo::ServiceProviderPtr tracing_service_provider_ptr;
+  ServiceProviderPtr tracing_service_provider_ptr;
   new TracingServiceProvider(mojo::GetProxy(&tracing_service_provider_ptr));
   application_manager_.ConnectToApplication(
       GURL("mojo:tracing"), GURL(""), nullptr,
@@ -318,8 +321,8 @@
 }
 
 void Context::Run(const GURL& url) {
-  mojo::ServiceProviderPtr services;
-  mojo::ServiceProviderPtr exposed_services;
+  ServiceProviderPtr services;
+  ServiceProviderPtr exposed_services;
 
   app_urls_.insert(url);
   application_manager_.ConnectToApplication(
diff --git a/shell/shell_apptest.cc b/shell/shell_apptest.cc
index 4b336ec..468e00c 100644
--- a/shell/shell_apptest.cc
+++ b/shell/shell_apptest.cc
@@ -21,6 +21,8 @@
 #include "shell/kPingable.h"
 #include "shell/test/pingable.mojom.h"
 
+using mojo::String;
+
 namespace {
 
 std::string GetURL(uint16_t port, const std::string& path) {
@@ -114,14 +116,14 @@
 TEST_F(ShellHTTPAppTest, Http) {
   PingablePtr pingable;
   application_impl()->ConnectToService(GetURL("app"), &pingable);
-  pingable->Ping("hello", [this](const mojo::String& app_url,
-                                 const mojo::String& connection_url,
-                                 const mojo::String& message) {
-    EXPECT_EQ(GetURL("app"), app_url);
-    EXPECT_EQ(GetURL("app"), connection_url);
-    EXPECT_EQ("hello", message);
-    base::MessageLoop::current()->Quit();
-  });
+  pingable->Ping("hello",
+                 [this](const String& app_url, const String& connection_url,
+                        const String& message) {
+                   EXPECT_EQ(GetURL("app"), app_url);
+                   EXPECT_EQ(GetURL("app"), connection_url);
+                   EXPECT_EQ("hello", message);
+                   base::MessageLoop::current()->Quit();
+                 });
   base::RunLoop().Run();
 }
 
@@ -130,14 +132,14 @@
 TEST_F(ShellHTTPAppTest, Redirect) {
   PingablePtr pingable;
   application_impl()->ConnectToService(GetURL("redirect"), &pingable);
-  pingable->Ping("hello", [this](const mojo::String& app_url,
-                                 const mojo::String& connection_url,
-                                 const mojo::String& message) {
-    EXPECT_EQ(GetURL("app"), app_url);
-    EXPECT_EQ(GetURL("app"), connection_url);
-    EXPECT_EQ("hello", message);
-    base::MessageLoop::current()->Quit();
-  });
+  pingable->Ping("hello",
+                 [this](const String& app_url, const String& connection_url,
+                        const String& message) {
+                   EXPECT_EQ(GetURL("app"), app_url);
+                   EXPECT_EQ(GetURL("app"), connection_url);
+                   EXPECT_EQ("hello", message);
+                   base::MessageLoop::current()->Quit();
+                 });
   base::RunLoop().Run();
 }
 
@@ -155,9 +157,9 @@
   application_impl()->ConnectToService(GetURL("app?bar"), &pingable2);
 
   int num_responses = 0;
-  auto callback = [this, &num_responses](const mojo::String& app_url,
-                                         const mojo::String& connection_url,
-                                         const mojo::String& message) {
+  auto callback = [this, &num_responses](const String& app_url,
+                                         const String& connection_url,
+                                         const String& message) {
     EXPECT_EQ(GetURL("app"), app_url);
     EXPECT_EQ("hello", message);
     ++num_responses;
@@ -179,14 +181,13 @@
 TEST_F(ShellAppTest, MojoURLQueryHandling) {
   PingablePtr pingable;
   application_impl()->ConnectToService("mojo:pingable_app?foo", &pingable);
-  auto callback =
-      [this](const mojo::String& app_url, const mojo::String& connection_url,
-             const mojo::String& message) {
-        EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true));
-        EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url);
-        EXPECT_EQ("hello", message);
-        base::MessageLoop::current()->Quit();
-      };
+  auto callback = [this](const String& app_url, const String& connection_url,
+                         const String& message) {
+    EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true));
+    EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url);
+    EXPECT_EQ("hello", message);
+    base::MessageLoop::current()->Quit();
+  };
   pingable->Ping("hello", callback);
   base::RunLoop().Run();
 }
diff --git a/shell/shell_test_base_unittest.cc b/shell/shell_test_base_unittest.cc
index cc39cb5..03d047d 100644
--- a/shell/shell_test_base_unittest.cc
+++ b/shell/shell_test_base_unittest.cc
@@ -17,6 +17,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
+using mojo::Callback;
 using mojo::test::ServiceReport;
 using mojo::test::ServiceReportPtr;
 using mojo::test::TestService;
@@ -243,11 +244,11 @@
   TestServicePtr service;
   ConnectToService(test_app_url(), &service);
   service->StartTrackingRequests(message_loop()->QuitWhenIdleClosure());
-  service->Ping(mojo::Callback<void()>());
+  service->Ping(Callback<void()>());
   message_loop()->Run();
 
   for (int i = 0; i < 8; i++)
-    service->Ping(mojo::Callback<void()>());
+    service->Ping(Callback<void()>());
   service->Ping(message_loop()->QuitWhenIdleClosure());
   message_loop()->Run();
 
@@ -273,7 +274,7 @@
   service->StartTrackingRequests(message_loop()->QuitWhenIdleClosure());
   message_loop()->Run();
   for (int i = 0; i < 5; i++)
-    service->Ping(mojo::Callback<void()>());
+    service->Ping(Callback<void()>());
   int64 time_result;
   service->ConnectToAppAndGetTime("mojo:test_request_tracker_app",
                                   SetAndQuit<int64>(&time_result));
@@ -282,10 +283,10 @@
   // Also make a few requests to the TimeService in the test_app.
   ConnectToService(test_app_url(), &time_service);
   time_service->StartTrackingRequests(message_loop()->QuitWhenIdleClosure());
-  time_service->GetPartyTime(mojo::Callback<void(uint64_t)>());
+  time_service->GetPartyTime(Callback<void(uint64_t)>());
   message_loop()->Run();
   for (int i = 0; i < 18; i++)
-    time_service->GetPartyTime(mojo::Callback<void(uint64_t)>());
+    time_service->GetPartyTime(Callback<void(uint64_t)>());
   // Flush the tasks with one more to quit.
   int64 party_time = 0;
   time_service->GetPartyTime(SetAndQuit<int64>(&party_time));
diff --git a/shell/test/pingable_app.cc b/shell/test/pingable_app.cc
index a708361..fe49993 100644
--- a/shell/test/pingable_app.cc
+++ b/shell/test/pingable_app.cc
@@ -12,6 +12,8 @@
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "shell/test/pingable.mojom.h"
 
+using mojo::String;
+
 class PingableImpl : public Pingable {
  public:
   PingableImpl(mojo::InterfaceRequest<Pingable> request,
@@ -25,9 +27,8 @@
 
  private:
   void Ping(
-      const mojo::String& message,
-      const mojo::Callback<void(mojo::String, mojo::String, mojo::String)>&
-          callback) override {
+      const String& message,
+      const mojo::Callback<void(String, String, String)>& callback) override {
     callback.Run(app_url_, connection_url_, message);
   }