Move small c/b/extensions classes into extensions namespace no.2

Since these classes are small, they can be all be moved in one cl without it
becoming overly large.

This one moves:
- ExtensionDataDeleter (now extensions::DataDeleter)
- ExtensionNavigationObserver (now extensions::NavigationObserver)
- PackExtensionJob
- PlatformAppBrowsertest
- ShellWindowRegistry
- ExtensionStartupUtil (see note in file)

BUG=117261
[email protected]

Review URL: https://chromiumcodereview.appspot.com/10824204

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151535 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index e2e7b46..05ef7c7 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -37,7 +37,7 @@
 #include "chrome/browser/defaults.h"
 #include "chrome/browser/extensions/extension_protocols.h"
 #include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extensions_startup.h"
+#include "chrome/browser/extensions/startup_helper.h"
 #include "chrome/browser/first_run/upgrade_util.h"
 #include "chrome/browser/google/google_search_counter.h"
 #include "chrome/browser/google/google_util.h"
@@ -461,8 +461,8 @@
       return true;
     }
 
-    ExtensionsStartupUtil ext_startup_util;
-    ext_startup_util.UninstallExtension(command_line, profile);
+    extensions::StartupHelper extension_startup_helper;
+    extension_startup_helper.UninstallExtension(command_line, profile);
     return true;
   }
 
@@ -990,8 +990,8 @@
   // If the command line specifies --pack-extension, attempt the pack extension
   // startup action and exit.
   if (parsed_command_line().HasSwitch(switches::kPackExtension)) {
-    ExtensionsStartupUtil extension_startup_util;
-    if (extension_startup_util.PackExtension(parsed_command_line()))
+    extensions::StartupHelper extension_startup_helper;
+    if (extension_startup_helper.PackExtension(parsed_command_line()))
       return content::RESULT_CODE_NORMAL_EXIT;
     return chrome::RESULT_CODE_PACK_EXTENSION_ERROR;
   }
@@ -1266,8 +1266,9 @@
   // specifies --uninstall-extension, attempt the uninstall extension startup
   // action.
   if (parsed_command_line().HasSwitch(switches::kUninstallExtension)) {
-    ExtensionsStartupUtil ext_startup_util;
-    if (ext_startup_util.UninstallExtension(parsed_command_line(), profile_))
+    extensions::StartupHelper extension_startup_helper;
+    if (extension_startup_helper.UninstallExtension(
+            parsed_command_line(), profile_))
       return content::RESULT_CODE_NORMAL_EXIT;
     return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR;
   }
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
index 0bc334d..c50e3d4a 100644
--- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
@@ -9,17 +9,17 @@
 
 using extensions::FileSystemChooseFileFunction;
 
-class FileSystemApiTest : public PlatformAppBrowserTest {
+class FileSystemApiTest : public extensions::PlatformAppBrowserTest {
  public:
   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
-    PlatformAppBrowserTest::SetUpCommandLine(command_line);
+    extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
     test_root_folder_ = test_data_dir_.AppendASCII("api_test")
         .AppendASCII("file_system");
   }
 
   virtual void TearDown() OVERRIDE {
     FileSystemChooseFileFunction::StopSkippingPickerForTest();
-    PlatformAppBrowserTest::TearDown();
+    extensions::PlatformAppBrowserTest::TearDown();
   };
 
  protected:
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
index b1ce8bb..4bc5b57 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
@@ -20,10 +20,11 @@
 
 namespace {
 
-class ExperimentalMediaGalleriesAppBrowserTest : public PlatformAppBrowserTest {
+class ExperimentalMediaGalleriesAppBrowserTest
+    : public extensions::PlatformAppBrowserTest {
  public:
   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
-    PlatformAppBrowserTest::SetUpCommandLine(command_line);
+    extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
     command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
   }
 };
diff --git a/chrome/browser/extensions/browser_tag_browsertest.cc b/chrome/browser/extensions/browser_tag_browsertest.cc
index 0d848a38..e63769a 100644
--- a/chrome/browser/extensions/browser_tag_browsertest.cc
+++ b/chrome/browser/extensions/browser_tag_browsertest.cc
@@ -13,10 +13,10 @@
 #include "ui/compositor/compositor_setup.h"
 #include "ui/gl/gl_switches.h"
 
-class BrowserTagTest : public PlatformAppBrowserTest {
+class BrowserTagTest : public extensions::PlatformAppBrowserTest {
  protected:
   virtual void SetUpCommandLine(CommandLine* command_line) {
-    PlatformAppBrowserTest::SetUpCommandLine(command_line);
+    extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
 #if !defined(OS_MACOSX)
     CHECK(test_launcher_utils::OverrideGLImplementation(
           command_line, gfx::kGLImplementationOSMesaName)) <<
diff --git a/chrome/browser/extensions/extension_data_deleter.cc b/chrome/browser/extensions/data_deleter.cc
similarity index 77%
rename from chrome/browser/extensions/extension_data_deleter.cc
rename to chrome/browser/extensions/data_deleter.cc
index d2ceb5ec..830aada8 100644
--- a/chrome/browser/extensions/extension_data_deleter.cc
+++ b/chrome/browser/extensions/data_deleter.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/extensions/extension_data_deleter.h"
+#include "chrome/browser/extensions/data_deleter.h"
 
 #include "base/bind.h"
 #include "base/file_util.h"
@@ -31,22 +31,21 @@
 using content::IndexedDBContext;
 using content::ResourceContext;
 
+namespace extensions {
+
 // static
-void ExtensionDataDeleter::StartDeleting(
-    Profile* profile,
-    const std::string& extension_id,
-    const GURL& storage_origin,
-    bool is_storage_isolated) {
+void DataDeleter::StartDeleting(Profile* profile,
+                                const std::string& extension_id,
+                                const GURL& storage_origin,
+                                bool is_storage_isolated) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(profile);
-  scoped_refptr<ExtensionDataDeleter> deleter =
-      new ExtensionDataDeleter(
-          profile, extension_id, storage_origin, is_storage_isolated);
+  scoped_refptr<DataDeleter> deleter = new DataDeleter(
+      profile, extension_id, storage_origin, is_storage_isolated);
 
   BrowserThread::PostTask(
       BrowserThread::IO, FROM_HERE,
-      base::Bind(
-          &ExtensionDataDeleter::DeleteCookiesOnIOThread, deleter));
+      base::Bind(&DataDeleter::DeleteCookiesOnIOThread, deleter));
 
   BrowserContext::GetDefaultDOMStorageContext(profile)->DeleteOrigin(
       storage_origin);
@@ -54,30 +53,29 @@
   BrowserThread::PostTask(
       BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
       base::Bind(
-          &ExtensionDataDeleter::DeleteIndexedDBOnWebkitThread, deleter,
+          &DataDeleter::DeleteIndexedDBOnWebkitThread,
+          deleter,
           make_scoped_refptr(BrowserContext::GetIndexedDBContext(profile))));
 
   BrowserThread::PostTask(
       BrowserThread::FILE, FROM_HERE,
-      base::Bind(
-          &ExtensionDataDeleter::DeleteDatabaseOnFileThread, deleter));
+      base::Bind(&DataDeleter::DeleteDatabaseOnFileThread, deleter));
 
   BrowserThread::PostTask(
       BrowserThread::FILE, FROM_HERE,
-      base::Bind(
-          &ExtensionDataDeleter::DeleteFileSystemOnFileThread, deleter));
+      base::Bind(&DataDeleter::DeleteFileSystemOnFileThread, deleter));
 
   BrowserThread::PostTask(
       BrowserThread::IO, FROM_HERE,
-      base::Bind(
-          &ExtensionDataDeleter::DeleteAppcachesOnIOThread, deleter,
-          profile->GetResourceContext()));
+      base::Bind(&DataDeleter::DeleteAppcachesOnIOThread,
+                 deleter,
+                 profile->GetResourceContext()));
 
   profile->GetExtensionService()->settings_frontend()->
       DeleteStorageSoon(extension_id);
 }
 
-ExtensionDataDeleter::ExtensionDataDeleter(
+DataDeleter::DataDeleter(
     Profile* profile,
     const std::string& extension_id,
     const GURL& storage_origin,
@@ -102,10 +100,10 @@
       webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_);
 }
 
-ExtensionDataDeleter::~ExtensionDataDeleter() {
+DataDeleter::~DataDeleter() {
 }
 
-void ExtensionDataDeleter::DeleteCookiesOnIOThread() {
+void DataDeleter::DeleteCookiesOnIOThread() {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   net::CookieMonster* cookie_monster =
       extension_request_context_->GetURLRequestContext()->cookie_store()->
@@ -115,20 +113,20 @@
         storage_origin_, net::CookieMonster::DeleteCallback());
 }
 
-void ExtensionDataDeleter::DeleteDatabaseOnFileThread() {
+void DataDeleter::DeleteDatabaseOnFileThread() {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
   int rv = database_tracker_->DeleteDataForOrigin(
       origin_id_, net::CompletionCallback());
   DCHECK(rv == net::OK || rv == net::ERR_IO_PENDING);
 }
 
-void ExtensionDataDeleter::DeleteIndexedDBOnWebkitThread(
+void DataDeleter::DeleteIndexedDBOnWebkitThread(
     scoped_refptr<IndexedDBContext> indexed_db_context) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
   indexed_db_context->DeleteForOrigin(storage_origin_);
 }
 
-void ExtensionDataDeleter::DeleteFileSystemOnFileThread() {
+void DataDeleter::DeleteFileSystemOnFileThread() {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
   file_system_context_->DeleteDataForOriginOnFileThread(storage_origin_);
 
@@ -139,8 +137,10 @@
     file_util::Delete(isolated_app_path_, true);
 }
 
-void ExtensionDataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) {
+void DataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   ResourceContext::GetAppCacheService(context)->DeleteAppCachesForOrigin(
       storage_origin_, net::CompletionCallback());
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/extension_data_deleter.h b/chrome/browser/extensions/data_deleter.h
similarity index 82%
rename from chrome/browser/extensions/extension_data_deleter.h
rename to chrome/browser/extensions/data_deleter.h
index d36b91e..a078795 100644
--- a/chrome/browser/extensions/extension_data_deleter.h
+++ b/chrome/browser/extensions/data_deleter.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 CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_
+#define CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_
 
 #include "base/file_path.h"
 #include "base/memory/ref_counted.h"
@@ -32,12 +32,13 @@
 
 class Profile;
 
+namespace extensions {
+
 // A helper class that takes care of removing local storage, databases and
 // cookies for a given extension. This is used by
 // ExtensionService::ClearExtensionData() upon uninstalling an extension.
-class ExtensionDataDeleter
-  : public base::RefCountedThreadSafe<
-        ExtensionDataDeleter, content::BrowserThread::DeleteOnUIThread> {
+class DataDeleter : public base::RefCountedThreadSafe<
+    DataDeleter, content::BrowserThread::DeleteOnUIThread> {
  public:
   // Starts removing data. The extension should not be running when this is
   // called. Cookies are deleted on the current thread, local storage and
@@ -52,14 +53,13 @@
  private:
   friend struct content::BrowserThread::DeleteOnThread<
       content::BrowserThread::UI>;
-  friend class base::DeleteHelper<ExtensionDataDeleter>;
+  friend class base::DeleteHelper<DataDeleter>;
 
-  ExtensionDataDeleter(
-      Profile* profile,
-      const std::string& extension_id,
-      const GURL& storage_origin,
-      bool is_storage_isolated);
-  ~ExtensionDataDeleter();
+  DataDeleter(Profile* profile,
+              const std::string& extension_id,
+              const GURL& storage_origin,
+              bool is_storage_isolated);
+  ~DataDeleter();
 
   // Deletes the cookies for the extension. May only be called on the io
   // thread.
@@ -103,7 +103,9 @@
   // is its directory which we should delete.
   FilePath isolated_app_path_;
 
-  DISALLOW_COPY_AND_ASSIGN(ExtensionDataDeleter);
+  DISALLOW_COPY_AND_ASSIGN(DataDeleter);
 };
 
-#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_
+}  // namespace extensions
+
+#endif  // CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 6425c251..8f3e8c0 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -43,8 +43,8 @@
 #include "chrome/browser/extensions/browser_event_router.h"
 #include "chrome/browser/extensions/component_loader.h"
 #include "chrome/browser/extensions/crx_installer.h"
+#include "chrome/browser/extensions/data_deleter.h"
 #include "chrome/browser/extensions/default_apps_trial.h"
-#include "chrome/browser/extensions/extension_data_deleter.h"
 #include "chrome/browser/extensions/extension_disabled_ui.h"
 #include "chrome/browser/extensions/extension_error_reporter.h"
 #include "chrome/browser/extensions/extension_error_ui.h"
@@ -757,10 +757,10 @@
   if (extension->is_hosted_app() &&
       !profile_->GetExtensionSpecialStoragePolicy()->
           IsStorageProtected(launch_web_url_origin)) {
-    ExtensionDataDeleter::StartDeleting(
+    extensions::DataDeleter::StartDeleting(
         profile_, extension_id, launch_web_url_origin, is_storage_isolated);
   }
-  ExtensionDataDeleter::StartDeleting(
+  extensions::DataDeleter::StartDeleting(
       profile_, extension_id, extension->url(), is_storage_isolated);
 
   UntrackTerminatedExtension(extension_id);
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index e06cdfa..c07d025 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -976,7 +976,7 @@
 
 // Receives notifications from a PackExtensionJob, indicating either that
 // packing succeeded or that there was some error.
-class PackExtensionTestClient : public PackExtensionJob::Client {
+class PackExtensionTestClient : public extensions::PackExtensionJob::Client {
  public:
   PackExtensionTestClient(const FilePath& expected_crx_path,
                           const FilePath& expected_private_key_path);
@@ -1747,9 +1747,9 @@
         temp_dir.path().Append(expected_private_key_names[i]);
     PackExtensionTestClient pack_client(expected_crx_path,
                                         expected_private_key_path);
-    scoped_refptr<PackExtensionJob> packer(
-        new PackExtensionJob(&pack_client, output_dir, FilePath(),
-                             ExtensionCreator::kOverwriteCRX));
+    scoped_refptr<extensions::PackExtensionJob> packer(
+        new extensions::PackExtensionJob(&pack_client, output_dir, FilePath(),
+                                         ExtensionCreator::kOverwriteCRX));
     packer->Start();
 
     // The packer will post a notification task to the current thread's message
diff --git a/chrome/browser/extensions/extension_system.cc b/chrome/browser/extensions/extension_system.cc
index 55e31a3..919ccc22 100644
--- a/chrome/browser/extensions/extension_system.cc
+++ b/chrome/browser/extensions/extension_system.cc
@@ -17,7 +17,6 @@
 #include "chrome/browser/extensions/extension_devtools_manager.h"
 #include "chrome/browser/extensions/extension_error_reporter.h"
 #include "chrome/browser/extensions/extension_info_map.h"
-#include "chrome/browser/extensions/extension_navigation_observer.h"
 #include "chrome/browser/extensions/extension_pref_store.h"
 #include "chrome/browser/extensions/extension_pref_value_map.h"
 #include "chrome/browser/extensions/extension_pref_value_map_factory.h"
@@ -27,6 +26,7 @@
 #include "chrome/browser/extensions/lazy_background_task_queue.h"
 #include "chrome/browser/extensions/management_policy.h"
 #include "chrome/browser/extensions/message_service.h"
+#include "chrome/browser/extensions/navigation_observer.h"
 #include "chrome/browser/extensions/state_store.h"
 #include "chrome/browser/extensions/unpacked_installer.h"
 #include "chrome/browser/extensions/user_script_master.h"
@@ -99,8 +99,7 @@
   lazy_background_task_queue_.reset(new LazyBackgroundTaskQueue(profile_));
   message_service_.reset(new MessageService(lazy_background_task_queue_.get()));
   extension_event_router_.reset(new EventRouter(profile_));
-  extension_navigation_observer_.reset(
-      new ExtensionNavigationObserver(profile_));
+  navigation_observer_.reset(new NavigationObserver(profile_));
 
   ExtensionErrorReporter::Init(true);  // allow noisy errors.
 
diff --git a/chrome/browser/extensions/extension_system.h b/chrome/browser/extensions/extension_system.h
index c7f93c2..884f036 100644
--- a/chrome/browser/extensions/extension_system.h
+++ b/chrome/browser/extensions/extension_system.h
@@ -18,7 +18,6 @@
 
 class ExtensionDevToolsManager;
 class ExtensionInfoMap;
-class ExtensionNavigationObserver;
 class ExtensionProcessManager;
 class ExtensionService;
 class Profile;
@@ -34,6 +33,7 @@
 class LazyBackgroundTaskQueue;
 class ManagementPolicy;
 class MessageService;
+class NavigationObserver;
 class RulesRegistryService;
 class StateStore;
 class UserScriptMaster;
@@ -213,7 +213,7 @@
     scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
     scoped_ptr<MessageService> message_service_;
     scoped_ptr<EventRouter> extension_event_router_;
-    scoped_ptr<ExtensionNavigationObserver> extension_navigation_observer_;
+    scoped_ptr<NavigationObserver> navigation_observer_;
   };
 
   Profile* profile_;
diff --git a/chrome/browser/extensions/extension_navigation_observer.cc b/chrome/browser/extensions/navigation_observer.cc
similarity index 77%
rename from chrome/browser/extensions/extension_navigation_observer.cc
rename to chrome/browser/extensions/navigation_observer.cc
index aef8c3a..5cd8956 100644
--- a/chrome/browser/extensions/extension_navigation_observer.cc
+++ b/chrome/browser/extensions/navigation_observer.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/extensions/extension_navigation_observer.h"
+#include "chrome/browser/extensions/navigation_observer.h"
 
 #include "chrome/browser/extensions/extension_install_ui.h"
 #include "chrome/browser/extensions/extension_service.h"
@@ -15,17 +15,17 @@
 using content::NavigationController;
 using content::NavigationEntry;
 
-ExtensionNavigationObserver::ExtensionNavigationObserver(Profile* profile)
-    : profile_(profile) {
+namespace extensions {
+
+NavigationObserver::NavigationObserver(Profile* profile) : profile_(profile) {
   RegisterForNotifications();
 }
 
-ExtensionNavigationObserver::~ExtensionNavigationObserver() {}
+NavigationObserver::~NavigationObserver() {}
 
-void ExtensionNavigationObserver::Observe(
-    int type,
-    const content::NotificationSource& source,
-    const content::NotificationDetails& details) {
+void NavigationObserver::Observe(int type,
+                                 const content::NotificationSource& source,
+                                 const content::NotificationDetails& details) {
   if (type != content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
     NOTREACHED();
     return;
@@ -40,12 +40,12 @@
   PromptToEnableExtensionIfNecessary(controller);
 }
 
-void ExtensionNavigationObserver::RegisterForNotifications() {
+void NavigationObserver::RegisterForNotifications() {
   registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
                  content::NotificationService::AllSources());
 }
 
-void ExtensionNavigationObserver::PromptToEnableExtensionIfNecessary(
+void NavigationObserver::PromptToEnableExtensionIfNecessary(
     NavigationController* nav_controller) {
   // Bail out if we're already running a prompt.
   if (!in_progress_prompt_extension_id_.empty())
@@ -56,8 +56,7 @@
     return;
 
   ExtensionService* extension_service = profile_->GetExtensionService();
-  const extensions::Extension* extension =
-      extension_service->disabled_extensions()->
+  const Extension* extension = extension_service->disabled_extensions()->
       GetExtensionOrAppByURL(ExtensionURLInfo(nav_entry->GetURL()));
   if (!extension)
     return;
@@ -67,8 +66,7 @@
     return;
   prompted_extensions_.insert(extension->id());
 
-  extensions::ExtensionPrefs* extension_prefs =
-      extension_service->extension_prefs();
+  ExtensionPrefs* extension_prefs = extension_service->extension_prefs();
   if (extension_prefs->DidExtensionEscalatePermissions(extension->id())) {
     // Keep track of the extension id and nav controller we're prompting for.
     // These must be reset in InstallUIProceed and InstallUIAbort.
@@ -82,9 +80,9 @@
   }
 }
 
-void ExtensionNavigationObserver::InstallUIProceed() {
+void NavigationObserver::InstallUIProceed() {
   ExtensionService* extension_service = profile_->GetExtensionService();
-  const extensions::Extension* extension = extension_service->GetExtensionById(
+  const Extension* extension = extension_service->GetExtensionById(
       in_progress_prompt_extension_id_, true);
   NavigationController* nav_controller =
       in_progress_prompt_navigation_controller_;
@@ -101,9 +99,9 @@
   nav_controller->Reload(true);
 }
 
-void ExtensionNavigationObserver::InstallUIAbort(bool user_initiated) {
+void NavigationObserver::InstallUIAbort(bool user_initiated) {
   ExtensionService* extension_service = profile_->GetExtensionService();
-  const extensions::Extension* extension = extension_service->GetExtensionById(
+  const Extension* extension = extension_service->GetExtensionById(
       in_progress_prompt_extension_id_, true);
 
   in_progress_prompt_extension_id_ = "";
@@ -116,3 +114,5 @@
   ExtensionService::RecordPermissionMessagesHistogram(
       extension, histogram_name.c_str());
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/extension_navigation_observer.h b/chrome/browser/extensions/navigation_observer.h
similarity index 74%
rename from chrome/browser/extensions/extension_navigation_observer.h
rename to chrome/browser/extensions/navigation_observer.h
index feb653f4..480f9833 100644
--- a/chrome/browser/extensions/extension_navigation_observer.h
+++ b/chrome/browser/extensions/navigation_observer.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 CHROME_BROWSER_EXTENSIONS_EXTENSION_NAVIGATION_OBSERVER_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_NAVIGATION_OBSERVER_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_
+#define CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_
 
 #include <set>
 #include <string>
@@ -18,15 +18,17 @@
 class NavigationController;
 }
 
-// The ExtensionNavigationObserver listens to navigation notifications. If the
-// user navigates into an extension that has been disabled due to a permission
+namespace extensions {
+
+// The NavigationObserver listens to navigation notifications. If the user
+// navigates into an extension that has been disabled due to a permission
 // increase, it prompts the user to accept the new permissions and re-enables
 // the extension.
-class ExtensionNavigationObserver : public ExtensionInstallPrompt::Delegate,
-                                    public content::NotificationObserver {
+class NavigationObserver : public ExtensionInstallPrompt::Delegate,
+                           public content::NotificationObserver {
  public:
-  explicit ExtensionNavigationObserver(Profile* profile);
-  virtual ~ExtensionNavigationObserver();
+  explicit NavigationObserver(Profile* profile);
+  virtual ~NavigationObserver();
 
   // content::NotificationObserver
   virtual void Observe(int type,
@@ -59,6 +61,10 @@
 
   // The extension ids we've already prompted the user about.
   std::set<std::string> prompted_extensions_;
+
+  DISALLOW_COPY_AND_ASSIGN(NavigationObserver);
 };
 
-#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_NAVIGATION_OBSERVER_H_
+}  // namespace extensions
+
+#endif  // CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_
diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc
index ac54f977..5dcfd9f 100644
--- a/chrome/browser/extensions/pack_extension_job.cc
+++ b/chrome/browser/extensions/pack_extension_job.cc
@@ -15,6 +15,8 @@
 
 using content::BrowserThread;
 
+namespace extensions {
+
 PackExtensionJob::PackExtensionJob(Client* client,
                                    const FilePath& root_directory,
                                    const FilePath& key_file,
@@ -51,7 +53,7 @@
 
   // TODO(aa): Need to internationalize the errors that ExtensionCreator
   // returns. See bug 20734.
-  extensions::ExtensionCreator creator;
+  ExtensionCreator creator;
   if (creator.Run(root_directory_, crx_file_out_, key_file_, key_file_out_,
                   run_flags_)) {
     if (asynchronous_) {
@@ -82,7 +84,7 @@
 
 void PackExtensionJob::ReportFailureOnClientThread(
     const std::string& error,
-    extensions::ExtensionCreator::ErrorType error_type) {
+    ExtensionCreator::ErrorType error_type) {
   if (client_)
     client_->OnPackFailure(error, error_type);
 }
@@ -103,3 +105,5 @@
         key_file_string);
   }
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h
index 78027de..4039d197d 100644
--- a/chrome/browser/extensions/pack_extension_job.h
+++ b/chrome/browser/extensions/pack_extension_job.h
@@ -13,6 +13,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "chrome/browser/extensions/extension_creator.h"
 
+namespace extensions {
 
 // Manages packing an extension on the file thread and reporting the result
 // back to the UI.
@@ -23,9 +24,8 @@
    public:
     virtual void OnPackSuccess(const FilePath& crx_file,
                                const FilePath& key_file) = 0;
-    virtual void OnPackFailure(
-        const std::string& message,
-        extensions::ExtensionCreator::ErrorType error_type) = 0;
+    virtual void OnPackFailure(const std::string& message,
+                               ExtensionCreator::ErrorType error_type) = 0;
 
    protected:
     virtual ~Client() {}
@@ -57,9 +57,8 @@
   // If |asynchronous_| is false, this is run on whichever thread calls it.
   void Run();
   void ReportSuccessOnClientThread();
-  void ReportFailureOnClientThread(
-      const std::string& error,
-      extensions::ExtensionCreator::ErrorType error_type);
+  void ReportFailureOnClientThread(const std::string& error,
+                                   ExtensionCreator::ErrorType error_type);
 
   content::BrowserThread::ID client_thread_id_;
   Client* client_;
@@ -73,4 +72,6 @@
   DISALLOW_COPY_AND_ASSIGN(PackExtensionJob);
 };
 
+}  // namespace extensions
+
 #endif  // CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_
diff --git a/chrome/browser/extensions/platform_app_browsertest.cc b/chrome/browser/extensions/platform_app_browsertest.cc
index c3bcdbd..65441b6 100644
--- a/chrome/browser/extensions/platform_app_browsertest.cc
+++ b/chrome/browser/extensions/platform_app_browsertest.cc
@@ -17,7 +17,8 @@
 #include "content/public/browser/render_process_host.h"
 
 using content::WebContents;
-using extensions::Extension;
+
+namespace extensions {
 
 namespace {
 // Non-abstract RenderViewContextMenu class.
@@ -222,7 +223,7 @@
 
   // Load the extension
   ResultCatcher catcher;
-  const extensions::Extension* extension = LoadExtension(
+  const Extension* extension = LoadExtension(
       test_data_dir_.AppendASCII("platform_apps/launch_file"));
   ASSERT_TRUE(extension);
 
@@ -313,3 +314,5 @@
   observer.Wait();
   ASSERT_EQ(2, browser()->tab_count());
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/platform_app_browsertest_util.cc b/chrome/browser/extensions/platform_app_browsertest_util.cc
index c108028a..71c3080 100644
--- a/chrome/browser/extensions/platform_app_browsertest_util.cc
+++ b/chrome/browser/extensions/platform_app_browsertest_util.cc
@@ -17,12 +17,12 @@
 #include "content/public/test/test_utils.h"
 
 using content::WebContents;
-using extensions::Extension;
 
 namespace utils = extension_function_test_utils;
 
-void PlatformAppBrowserTest::SetUpCommandLine(
-    CommandLine* command_line) {
+namespace extensions {
+
+void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) {
   ExtensionBrowserTest::SetUpCommandLine(command_line);
   command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
 }
@@ -119,3 +119,5 @@
   window->Close();
   destroyed_observer.Wait();
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/platform_app_browsertest_util.h b/chrome/browser/extensions/platform_app_browsertest_util.h
index 628fca6..7aa8d32 100644
--- a/chrome/browser/extensions/platform_app_browsertest_util.h
+++ b/chrome/browser/extensions/platform_app_browsertest_util.h
@@ -8,9 +8,6 @@
 
 #include "chrome/browser/extensions/extension_apitest.h"
 
-namespace extensions {
-class Extension;
-}
 
 namespace content {
 class WebContents;
@@ -19,6 +16,9 @@
 class CommandLine;
 class ShellWindow;
 
+namespace extensions {
+class Extension;
+
 class PlatformAppBrowserTest : public ExtensionApiTest {
  public:
   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
@@ -26,7 +26,7 @@
  protected:
   // Runs the app named |name| out of the platform_apps subdirectory. Waits
   // until it is launched.
-  const extensions::Extension* LoadAndLaunchPlatformApp(const char* name);
+  const Extension* LoadAndLaunchPlatformApp(const char* name);
 
   // Gets the WebContents associated with the first shell window that is found
   // (most tests only deal with one platform app window, so this is good
@@ -35,13 +35,12 @@
 
   // Runs chrome.windows.getAll for the given extension and returns the number
   // of windows that the function returns.
-  size_t RunGetWindowsFunctionForExtension(
-      const extensions::Extension* extension);
+  size_t RunGetWindowsFunctionForExtension(const Extension* extension);
 
   // Runs chrome.windows.get(|window_id|) for the the given extension and
   // returns whether or not a window was found.
-  bool RunGetWindowFunctionForExtension(
-      int window_id, const extensions::Extension* extension);
+  bool RunGetWindowFunctionForExtension(int window_id,
+                                        const Extension* extension);
 
   // Returns the number of shell windows.
   size_t GetShellWindowCount();
@@ -55,10 +54,12 @@
   void SetCommandLineArg(const std::string& test_file);
 
   // Creates an empty shell window for |extension|.
-  ShellWindow* CreateShellWindow(const extensions::Extension* extension);
+  ShellWindow* CreateShellWindow(const Extension* extension);
 
   // Closes |window| and waits until it's gone.
   void CloseShellWindow(ShellWindow* window);
 };
 
+}
+
 #endif  // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index d50fdec8..5bcf3721 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -30,8 +30,8 @@
 #include "webkit/glue/web_intent_service_data.h"
 
 using content::BrowserThread;
-using extensions::Extension;
-using extensions::ExtensionSystem;
+
+namespace extensions {
 
 namespace {
 
@@ -305,8 +305,6 @@
 
 }  // namespace
 
-namespace extensions {
-
 void LaunchPlatformApp(Profile* profile,
                        const Extension* extension,
                        const CommandLine* command_line,
diff --git a/chrome/browser/extensions/settings/settings_frontend_unittest.cc b/chrome/browser/extensions/settings/settings_frontend_unittest.cc
index abd0115..7c96061 100644
--- a/chrome/browser/extensions/settings/settings_frontend_unittest.cc
+++ b/chrome/browser/extensions/settings/settings_frontend_unittest.cc
@@ -150,7 +150,7 @@
     ASSERT_FALSE(result->HasError());
   }
 
-  // This would be triggered by extension uninstall via an ExtensionDataDeleter.
+  // This would be triggered by extension uninstall via a DataDeleter.
   frontend_->DeleteStorageSoon(id);
   MessageLoop::current()->RunAllPending();
 
diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc
index e97138d..2bd6fc6 100644
--- a/chrome/browser/extensions/shell_window_registry.cc
+++ b/chrome/browser/extensions/shell_window_registry.cc
@@ -9,6 +9,8 @@
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/web_contents.h"
 
+namespace extensions {
+
 ShellWindowRegistry::ShellWindowRegistry() {}
 
 ShellWindowRegistry::~ShellWindowRegistry() {}
@@ -103,3 +105,5 @@
 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() {
   return false;
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h
index 3e248cb..e3d2c793 100644
--- a/chrome/browser/extensions/shell_window_registry.h
+++ b/chrome/browser/extensions/shell_window_registry.h
@@ -21,6 +21,8 @@
 class RenderViewHost;
 }
 
+namespace extensions {
+
 // The ShellWindowRegistry tracks the ShellWindows for all platform apps for a
 // particular profile.
 // This class is planned to evolve into tracking all PlatformApps for a
@@ -89,4 +91,6 @@
   ObserverList<Observer> observers_;
 };
 
+}  // namespace extensions
+
 #endif  // CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_
diff --git a/chrome/browser/extensions/extensions_startup.cc b/chrome/browser/extensions/startup_helper.cc
similarity index 73%
rename from chrome/browser/extensions/extensions_startup.cc
rename to chrome/browser/extensions/startup_helper.cc
index cd11840..2b74c7e2 100644
--- a/chrome/browser/extensions/extensions_startup.cc
+++ b/chrome/browser/extensions/startup_helper.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/extensions/extensions_startup.h"
+#include "chrome/browser/extensions/startup_helper.h"
 
 #include "base/string_util.h"
 #include "base/stringprintf.h"
@@ -12,11 +12,12 @@
 #include "chrome/browser/ui/simple_message_box.h"
 #include "chrome/common/chrome_switches.h"
 
-ExtensionsStartupUtil::ExtensionsStartupUtil() : pack_job_succeeded_(false) {}
+namespace extensions {
 
-void ExtensionsStartupUtil::OnPackSuccess(
-    const FilePath& crx_path,
-    const FilePath& output_private_key_path) {
+StartupHelper::StartupHelper() : pack_job_succeeded_(false) {}
+
+void StartupHelper::OnPackSuccess(const FilePath& crx_path,
+                                  const FilePath& output_private_key_path) {
   pack_job_succeeded_ = true;
   chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Success"),
       PackExtensionJob::StandardSuccessMessage(crx_path,
@@ -24,14 +25,13 @@
       chrome::MESSAGE_BOX_TYPE_INFORMATION);
 }
 
-void ExtensionsStartupUtil::OnPackFailure(
-    const std::string& error_message,
-    extensions::ExtensionCreator::ErrorType type) {
+void StartupHelper::OnPackFailure(const std::string& error_message,
+                                  ExtensionCreator::ErrorType type) {
   chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Error"),
       UTF8ToUTF16(error_message), chrome::MESSAGE_BOX_TYPE_WARNING);
 }
 
-bool ExtensionsStartupUtil::PackExtension(const CommandLine& cmd_line) {
+bool StartupHelper::PackExtension(const CommandLine& cmd_line) {
   if (!cmd_line.HasSwitch(switches::kPackExtension))
     return false;
 
@@ -45,15 +45,15 @@
   // Launch a job to perform the packing on the file thread.  Ignore warnings
   // from the packing process. (e.g. Overwrite any existing crx file.)
   pack_job_ = new PackExtensionJob(this, src_dir, private_key_path,
-                                   extensions::ExtensionCreator::kOverwriteCRX);
+                                   ExtensionCreator::kOverwriteCRX);
   pack_job_->set_asynchronous(false);
   pack_job_->Start();
 
   return pack_job_succeeded_;
 }
 
-bool ExtensionsStartupUtil::UninstallExtension(const CommandLine& cmd_line,
-                                               Profile* profile) {
+bool StartupHelper::UninstallExtension(const CommandLine& cmd_line,
+                                       Profile* profile) {
   DCHECK(profile);
 
   if (!cmd_line.HasSwitch(switches::kUninstallExtension))
@@ -69,7 +69,9 @@
                                                     extension_id);
 }
 
-ExtensionsStartupUtil::~ExtensionsStartupUtil() {
+StartupHelper::~StartupHelper() {
   if (pack_job_.get())
     pack_job_->ClearClient();
 }
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/extensions_startup.h b/chrome/browser/extensions/startup_helper.h
similarity index 67%
rename from chrome/browser/extensions/extensions_startup.h
rename to chrome/browser/extensions/startup_helper.h
index ba2d3752..f4aedc4 100644
--- a/chrome/browser/extensions/extensions_startup.h
+++ b/chrome/browser/extensions/startup_helper.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 CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
+#define CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
 
 #include "base/memory/ref_counted.h"
 #include "chrome/browser/extensions/pack_extension_job.h"
@@ -11,17 +11,18 @@
 class CommandLine;
 class Profile;
 
+namespace extensions {
+
 // Initialization helpers for various Extension startup actions.
-class ExtensionsStartupUtil : public PackExtensionJob::Client {
+class StartupHelper : public PackExtensionJob::Client {
  public:
-  ExtensionsStartupUtil();
-  virtual ~ExtensionsStartupUtil();
+  StartupHelper();
+  virtual ~StartupHelper();
 
   virtual void OnPackSuccess(const FilePath& crx_path,
                              const FilePath& output_private_key_path) OVERRIDE;
-  virtual void OnPackFailure(
-      const std::string& error_message,
-      extensions::ExtensionCreator::ErrorType type) OVERRIDE;
+  virtual void OnPackFailure(const std::string& error_message,
+                             ExtensionCreator::ErrorType type) OVERRIDE;
 
   // Handle --pack-extension flag from the |cmd_line| by packing the specified
   // extension. Returns false if the pack job failed.
@@ -36,7 +37,9 @@
   scoped_refptr<PackExtensionJob> pack_job_;
   bool pack_job_succeeded_;
 
-  DISALLOW_COPY_AND_ASSIGN(ExtensionsStartupUtil);
+  DISALLOW_COPY_AND_ASSIGN(StartupHelper);
 };
 
-#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_
+}  // namespace extensions
+
+#endif  // CHROME_BROWSER_EXTENSIONS_STARTUP_HELPER_H_
diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h
index ad397ec..6fc8736 100644
--- a/chrome/browser/profiles/profile_impl.h
+++ b/chrome/browser/profiles/profile_impl.h
@@ -20,7 +20,6 @@
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
 
-class ExtensionNavigationObserver;
 class NetPrefObserver;
 class PrefService;
 class PromoResourceService;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index e3730c4..f6502543 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -76,7 +76,7 @@
   }
   instance_ = this;
   model_->AddObserver(this);
-  ShellWindowRegistry::Get(profile_)->AddObserver(this);
+  extensions::ShellWindowRegistry::Get(profile_)->AddObserver(this);
   app_tab_helper_.reset(new LauncherAppTabHelper(profile_));
   app_icon_loader_.reset(new LauncherAppIconLoader(profile_, this));
 
@@ -93,7 +93,7 @@
 }
 
 ChromeLauncherController::~ChromeLauncherController() {
-  ShellWindowRegistry::Get(profile_)->RemoveObserver(this);
+  extensions::ShellWindowRegistry::Get(profile_)->RemoveObserver(this);
   model_->RemoveObserver(this);
   for (IDToItemMap::iterator i = id_to_item_map_.begin();
        i != id_to_item_map_.end(); ++i) {
@@ -197,7 +197,7 @@
   DCHECK(id_to_item_map_.find(id) != id_to_item_map_.end());
   DCHECK(!id_to_item_map_[id].controller);
 
-  if (ShellWindowRegistry::Get(profile_)->GetShellWindowsForApp(
+  if (extensions::ShellWindowRegistry::Get(profile_)->GetShellWindowsForApp(
       id_to_item_map_[id].app_id).size() > 0) {
     int index = model_->ItemIndexByID(id);
     ash::LauncherItem item = model_->items()[index];
@@ -706,9 +706,9 @@
 
   DCHECK(id_to_item_map_.find(id) != id_to_item_map_.end());
   platform_app_windows_.remove(window);
-  ShellWindowRegistry::ShellWindowSet remaining_windows =
-      ShellWindowRegistry::Get(profile_)->GetShellWindowsForApp(
-      id_to_item_map_[id].app_id);
+  extensions::ShellWindowRegistry::ShellWindowSet remaining_windows =
+      extensions::ShellWindowRegistry::Get(profile_)->GetShellWindowsForApp(
+          id_to_item_map_[id].app_id);
 
   // We can't count on getting called before or after the ShellWindowRegistry.
   if (remaining_windows.size() > 1 ||
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
index 2e9fb23..411a5ead 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -51,7 +51,7 @@
       public ash::LauncherModelObserver,
       public ash::ShellObserver,
       public content::NotificationObserver,
-      public ShellWindowRegistry::Observer,
+      public extensions::ShellWindowRegistry::Observer,
       public aura::client::ActivationChangeObserver,
       public aura::WindowObserver {
  public:
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
index 1d83f87..1503dd15 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -38,7 +38,7 @@
 using extensions::Extension;
 using content::WebContents;
 
-typedef PlatformAppBrowserTest LauncherPlatformAppBrowserTest;
+typedef extensions::PlatformAppBrowserTest LauncherPlatformAppBrowserTest;
 
 class LauncherAppBrowserTest : public ExtensionBrowserTest {
  protected:
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc
index ec323fca..5e3f1d9 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -72,7 +72,7 @@
   // This object will delete itself when the window is closed.
   ShellWindow* window =
       ShellWindow::CreateImpl(profile, extension, url, params);
-  ShellWindowRegistry::Get(profile)->AddShellWindow(window);
+  extensions::ShellWindowRegistry::Get(profile)->AddShellWindow(window);
   return window;
 }
 
@@ -235,7 +235,7 @@
 }
 
 void ShellWindow::OnNativeClose() {
-  ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
+  extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
   delete this;
 }
 
diff --git a/chrome/browser/ui/extensions/shell_window.h b/chrome/browser/ui/extensions/shell_window.h
index 1c684021..078347d0 100644
--- a/chrome/browser/ui/extensions/shell_window.h
+++ b/chrome/browser/ui/extensions/shell_window.h
@@ -26,7 +26,9 @@
 
 namespace extensions {
 class Extension;
+class PlatformAppBrowserTest;
 class WindowController;
+
 struct DraggableRegion;
 }
 
@@ -89,7 +91,7 @@
 
  private:
   // PlatformAppBrowserTest needs access to web_contents()
-  friend class PlatformAppBrowserTest;
+  friend class extensions::PlatformAppBrowserTest;
 
   // Instantiates a platform-specific ShellWindow subclass (one implementation
   // per platform). Public users of ShellWindow should use ShellWindow::Create.
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc
index 3dfa69c..22bbc2e3 100644
--- a/chrome/browser/ui/views/select_file_dialog_extension.cc
+++ b/chrome/browser/ui/views/select_file_dialog_extension.cc
@@ -277,7 +277,8 @@
         g_browser_process->profile_manager()->GetLoadedProfiles();
     for (std::vector<Profile*>::const_iterator i(profiles.begin());
          i < profiles.end(); ++i) {
-      ShellWindowRegistry* registry = ShellWindowRegistry::Get(*i);
+      extensions::ShellWindowRegistry* registry =
+          extensions::ShellWindowRegistry::Get(*i);
       DCHECK(registry);
       ShellWindow* shell_window = registry->GetShellWindowForNativeWindow(
           owner_window);
diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
index 9381cff6..427dadd 100644
--- a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
+++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc
@@ -69,8 +69,8 @@
                                          const FilePath& pem_file) {
   ListValue arguments;
   arguments.Append(Value::CreateStringValue(
-      UTF16ToUTF8(PackExtensionJob::StandardSuccessMessage(crx_file,
-                                                           pem_file))));
+      UTF16ToUTF8(extensions::PackExtensionJob::StandardSuccessMessage(
+          crx_file, pem_file))));
   web_ui()->CallJavascriptFunction(
       "PackExtensionOverlay.showSuccessMessage", arguments);
 }
@@ -141,7 +141,8 @@
     return;
   }
 
-  pack_job_ = new PackExtensionJob(this, root_directory, key_file, run_flags);
+  pack_job_ = new extensions::PackExtensionJob(
+      this, root_directory, key_file, run_flags);
   pack_job_->Start();
 }
 
diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.h b/chrome/browser/ui/webui/extensions/pack_extension_handler.h
index 1ffe7d7..85aafc545 100644
--- a/chrome/browser/ui/webui/extensions/pack_extension_handler.h
+++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.h
@@ -16,7 +16,7 @@
 // Clear browser data handler page UI handler.
 class PackExtensionHandler : public content::WebUIMessageHandler,
                              public ui::SelectFileDialog::Listener,
-                             public PackExtensionJob::Client {
+                             public extensions::PackExtensionJob::Client {
  public:
   PackExtensionHandler();
   virtual ~PackExtensionHandler();
@@ -55,7 +55,7 @@
   void ShowAlert(const std::string& message);
 
   // Used to package the extension.
-  scoped_refptr<PackExtensionJob> pack_job_;
+  scoped_refptr<extensions::PackExtensionJob> pack_job_;
 
   // Returned by the SelectFileDialog machinery. Used to initiate the selection
   // dialog.