summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 12:44:06 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 12:44:06 +0000
commitadf5a10eeb5dc230f27d3b1344f2111bdfcd97d6 (patch)
tree8ba5fbfcb3ddaa54355fa3b03cbdcadcbc6d875d /extensions
parent248ee9be3db637800a1bf7b13817df43f904248b (diff)
downloadchromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.zip
chromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.tar.gz
chromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.tar.bz2
Move extension notifications to extensions/browser/notification_types.h
As part of the extensions module refactor we temporarily allowed the use of chrome_notification_types.h in src/extensions. However, this allowed code moving into src/extensions to listen to notifications from Chrome, which was a layering violation. This CL moves all the extensions notifications into their own header and cleans up DEPS to disallow the exception. BUG=392622 TEST=compiles, unit_tests, browser_tests, extensions_unittests TBR=miket@chromium.org for apps/ Review URL: https://codereview.chromium.org/425303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/DEPS5
-rw-r--r--extensions/browser/api/api_resource_manager.h10
-rw-r--r--extensions/browser/api/runtime/runtime_api.cc6
-rw-r--r--extensions/browser/api/runtime/runtime_apitest.cc4
-rw-r--r--extensions/browser/api/test/test_api.cc8
-rw-r--r--extensions/browser/event_router.cc16
-rw-r--r--extensions/browser/extension_host.cc19
-rw-r--r--extensions/browser/extension_icon_image.cc6
-rw-r--r--extensions/browser/image_loader_unittest.cc4
-rw-r--r--extensions/browser/lazy_background_task_queue.cc12
-rw-r--r--extensions/browser/notification_types.h226
-rw-r--r--extensions/browser/process_manager.cc37
-rw-r--r--extensions/browser/process_manager_unittest.cc32
-rw-r--r--extensions/extensions.gyp1
-rw-r--r--extensions/shell/DEPS4
-rw-r--r--extensions/shell/browser/shell_browsertest.cc4
-rw-r--r--extensions/shell/browser/shell_extension_system.cc6
17 files changed, 316 insertions, 84 deletions
diff --git a/extensions/DEPS b/extensions/DEPS
index f0606ba..fede72f 100644
--- a/extensions/DEPS
+++ b/extensions/DEPS
@@ -12,13 +12,8 @@ include_rules = [
"+testing",
"+ui",
- # Temporarily allowed includes as part of the app shell/extensions refactor.
- #
# NOTE: Please do not add includes without talking to the app shell team;
# see OWNERS for this directory.
- #
- # TODO(jamescook): Remove this. http://crbug.com/392622
- "!chrome/browser/chrome_notification_types.h",
]
specific_include_rules = {
diff --git a/extensions/browser/api/api_resource_manager.h b/extensions/browser/api/api_resource_manager.h
index 56795e6..c220278 100644
--- a/extensions/browser/api/api_resource_manager.h
+++ b/extensions/browser/api/api_resource_manager.h
@@ -12,7 +12,6 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
@@ -20,6 +19,7 @@
#include "content/public/browser/notification_service.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_host.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/extension.h"
namespace extensions {
@@ -117,10 +117,10 @@ class ApiResourceManager : public BrowserContextKeyedAPI,
explicit ApiResourceManager(content::BrowserContext* context)
: data_(new ApiResourceData()) {
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::NotificationService::AllSources());
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::NotificationService::AllSources());
}
// For Testing.
@@ -186,13 +186,13 @@ class ApiResourceManager : public BrowserContextKeyedAPI,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
std::string id = content::Details<extensions::UnloadedExtensionInfo>(
details)->extension->id();
data_->InitiateExtensionUnloadedCleanup(id);
break;
}
- case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
data_->InitiateExtensionSuspendedCleanup(host->extension_id());
break;
diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc
index b028aee..95ca66a 100644
--- a/extensions/browser/api/runtime/runtime_api.cc
+++ b/extensions/browser/api/runtime/runtime_api.cc
@@ -12,7 +12,6 @@
#include "base/metrics/histogram.h"
#include "base/values.h"
#include "base/version.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/notification_service.h"
@@ -27,6 +26,7 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/api/runtime.h"
#include "extensions/common/error_utils.h"
@@ -141,7 +141,7 @@ RuntimeAPI::RuntimeAPI(content::BrowserContext* context)
dispatch_chrome_updated_event_(false),
extension_registry_observer_(this) {
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(context));
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
@@ -161,7 +161,7 @@ RuntimeAPI::~RuntimeAPI() {
void RuntimeAPI::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type);
+ DCHECK_EQ(extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, type);
// We're done restarting Chrome after an update.
dispatch_chrome_updated_event_ = false;
diff --git a/extensions/browser/api/runtime/runtime_apitest.cc b/extensions/browser/api/runtime/runtime_apitest.cc
index 167a91a..2f92756 100644
--- a/extensions/browser/api/runtime/runtime_apitest.cc
+++ b/extensions/browser/api/runtime/runtime_apitest.cc
@@ -97,10 +97,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_ChromeRuntimeReload) {
// anyway.
for (int i = 0; i < 30; i++) {
content::WindowedNotificationObserver unload_observer(
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::NotificationService::AllSources());
content::WindowedNotificationObserver load_observer(
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::NotificationService::AllSources());
ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait(
diff --git a/extensions/browser/api/test/test_api.cc b/extensions/browser/api/test/test_api.cc
index 1dd1f93..4faaa03 100644
--- a/extensions/browser/api/test/test_api.cc
+++ b/extensions/browser/api/test/test_api.cc
@@ -8,11 +8,11 @@
#include "base/command_line.h"
#include "base/memory/singleton.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/api/test.h"
namespace {
@@ -49,7 +49,7 @@ TestNotifyPassFunction::~TestNotifyPassFunction() {}
bool TestNotifyPassFunction::RunSafe() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_PASSED,
+ extensions::NOTIFICATION_EXTENSION_TEST_PASSED,
content::Source<content::BrowserContext>(dispatcher()->browser_context()),
content::NotificationService::NoDetails());
return true;
@@ -61,7 +61,7 @@ bool TestNotifyFailFunction::RunSafe() {
scoped_ptr<NotifyFail::Params> params(NotifyFail::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_FAILED,
+ extensions::NOTIFICATION_EXTENSION_TEST_FAILED,
content::Source<content::BrowserContext>(dispatcher()->browser_context()),
content::Details<std::string>(&params->message));
return true;
@@ -80,7 +80,7 @@ bool TestSendMessageFunction::RunAsync() {
scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
+ extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
content::Source<TestSendMessageFunction>(this),
content::Details<std::string>(&params->message));
return true;
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index 21985b1..d8ae867 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -11,7 +11,6 @@
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "base/values.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -23,6 +22,7 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/extension.h"
@@ -174,12 +174,14 @@ EventRouter::EventRouter(BrowserContext* browser_context,
content::NotificationService::AllSources());
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
content::NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_ENABLED,
content::Source<BrowserContext>(browser_context_));
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::Source<BrowserContext>(browser_context_));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::Source<BrowserContext>(browser_context_));
}
@@ -735,7 +737,7 @@ void EventRouter::Observe(int type,
listeners_.RemoveListenersForProcess(renderer);
break;
}
- case chrome::NOTIFICATION_EXTENSION_ENABLED: {
+ case extensions::NOTIFICATION_EXTENSION_ENABLED: {
// If the extension has a lazy background page, make sure it gets loaded
// to register the events the extension is interested in.
const Extension* extension =
@@ -748,7 +750,7 @@ void EventRouter::Observe(int type,
}
break;
}
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
// Add all registered lazy listeners to our cache.
const Extension* extension =
content::Details<const Extension>(details).ptr();
@@ -762,7 +764,7 @@ void EventRouter::Observe(int type,
listeners_.LoadFilteredLazyListeners(extension->id(), *filtered_events);
break;
}
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
// Remove all registered lazy listeners from our cache.
UnloadedExtensionInfo* unloaded =
content::Details<UnloadedExtensionInfo>(details).ptr();
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc
index e1de908..2f0572e 100644
--- a/extensions/browser/extension_host.cc
+++ b/extensions/browser/extension_host.cc
@@ -14,7 +14,6 @@
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -31,6 +30,7 @@
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/view_type_utils.h"
@@ -140,7 +140,8 @@ ExtensionHost::ExtensionHost(const Extension* extension,
// Listen for when an extension is unloaded from the same profile, as it may
// be the same extension that this points to.
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::Source<BrowserContext>(browser_context_));
// Set up web contents observers and pref observers.
@@ -154,7 +155,7 @@ ExtensionHost::~ExtensionHost() {
since_created_.Elapsed());
}
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
ProcessCreationQueue::GetInstance()->Remove(this);
@@ -210,7 +211,7 @@ bool ExtensionHost::IsBackgroundPage() const {
void ExtensionHost::Close() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
@@ -219,7 +220,7 @@ void ExtensionHost::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
// The extension object will be deleted after this notification has been
// sent. NULL it out so that dirty pointer issues don't arise in cases
// when multiple ExtensionHost objects pointing to the same Extension are
@@ -256,7 +257,7 @@ void ExtensionHost::RenderProcessGone(base::TerminationStatus status) {
// and they aren't all going to use ExtensionHost. This should be in someplace
// more central, like EPM maybe.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
+ extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
@@ -288,7 +289,7 @@ void ExtensionHost::DidStopLoading(content::RenderViewHost* render_view_host) {
// Send the notification last, because it might result in this being
// deleted.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
+ extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
@@ -314,7 +315,7 @@ void ExtensionHost::OnDocumentAvailable() {
->runtime_data()
->SetBackgroundPageReady(extension_, true);
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
+ extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
content::Source<const Extension>(extension_),
content::NotificationService::NoDetails());
}
@@ -414,7 +415,7 @@ void ExtensionHost::AddNewContents(WebContents* source,
void ExtensionHost::RenderViewReady() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
+ extensions::NOTIFICATION_EXTENSION_HOST_CREATED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc
index 99473b1..e2c7e13 100644
--- a/extensions/browser/extension_icon_image.cc
+++ b/extensions/browser/extension_icon_image.cc
@@ -7,9 +7,9 @@
#include <vector>
#include "base/bind.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "extensions/browser/image_loader.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/extension.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/canvas_image_source.h"
@@ -150,7 +150,7 @@ IconImage::IconImage(
image_skia_ = gfx::ImageSkia(source_, resource_size);
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_REMOVED,
+ extensions::NOTIFICATION_EXTENSION_REMOVED,
content::NotificationService::AllSources());
}
@@ -228,7 +228,7 @@ void IconImage::OnImageLoaded(float scale, const gfx::Image& image_in) {
void IconImage::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_REMOVED);
+ DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_REMOVED);
const Extension* extension = content::Details<const Extension>(details).ptr();
diff --git a/extensions/browser/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc
index 68b93b0..39ae9e2 100644
--- a/extensions/browser/image_loader_unittest.cc
+++ b/extensions/browser/image_loader_unittest.cc
@@ -9,12 +9,12 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread.h"
#include "extensions/browser/component_extension_resource_manager.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
@@ -189,7 +189,7 @@ TEST_F(ImageLoaderTest, DeleteExtensionWhileWaitingForCache) {
UnloadedExtensionInfo details(extension.get(),
UnloadedExtensionInfo::REASON_UNINSTALL);
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::NotificationService::AllSources(),
content::Details<UnloadedExtensionInfo>(&details));
diff --git a/extensions/browser/lazy_background_task_queue.cc b/extensions/browser/lazy_background_task_queue.cc
index 4b8ee09..d5a3afa 100644
--- a/extensions/browser/lazy_background_task_queue.cc
+++ b/extensions/browser/lazy_background_task_queue.cc
@@ -5,7 +5,6 @@
#include "extensions/browser/lazy_background_task_queue.h"
#include "base/callback.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -16,6 +15,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/extension.h"
@@ -28,9 +28,11 @@ namespace extensions {
LazyBackgroundTaskQueue::LazyBackgroundTaskQueue(
content::BrowserContext* browser_context)
: browser_context_(browser_context), extension_registry_observer_(this) {
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::NotificationService::AllBrowserContextsAndSources());
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context));
@@ -137,7 +139,7 @@ void LazyBackgroundTaskQueue::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: {
// If an on-demand background page finished loading, dispatch queued up
// events for it.
ExtensionHost* host =
@@ -148,7 +150,7 @@ void LazyBackgroundTaskQueue::Observe(
}
break;
}
- case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
// Notify consumers about the load failure when the background host dies.
// This can happen if the extension crashes. This is not strictly
// necessary, since we also unload the extension in that case (which
diff --git a/extensions/browser/notification_types.h b/extensions/browser/notification_types.h
new file mode 100644
index 0000000..74ab91c
--- /dev/null
+++ b/extensions/browser/notification_types.h
@@ -0,0 +1,226 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
+#define EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
+
+#include "content/public/browser/notification_types.h"
+
+namespace extensions {
+
+// Only notifications fired by the extensions module should be here. The
+// extensions module should not listen to notifications fired by the
+// embedder.
+enum NotificationType {
+ NOTIFICATION_EXTENSIONS_START = content::NOTIFICATION_CONTENT_END,
+
+ // Sent when a CrxInstaller finishes. Source is the CrxInstaller that
+ // finished. The details are the extension which was installed.
+ NOTIFICATION_CRX_INSTALLER_DONE = NOTIFICATION_EXTENSIONS_START,
+
+ // Sent when the known installed extensions have all been loaded. In
+ // testing scenarios this can happen multiple times if extensions are
+ // unloaded and reloaded. The source is a BrowserContext*.
+ //
+ // DEPRECATED: Use ExtensionSystem::Get(browser_context)->ready().Post().
+ NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
+
+ // Sent when a new extension is loaded. The details are an Extension, and
+ // the source is a BrowserContext*.
+ //
+ // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
+ NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+
+ // An error occured while attempting to load an extension. The details are a
+ // string with details about why the load failed.
+ NOTIFICATION_EXTENSION_LOAD_ERROR,
+
+ // Sent when an extension is enabled. Under most circumstances, listeners will
+ // want to use ExtensionRegistryObserver::OnExtensionLoaded(). This
+ // notification is only fired when the "Enable" button is hit in the
+ // extensions tab. The details are an Extension, and the source is a
+ // BrowserContext*.
+ NOTIFICATION_EXTENSION_ENABLED,
+
+ // Sent when attempting to load a new extension, but they are disabled. The
+ // details are an Extension, and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_UPDATE_DISABLED,
+
+ // Sent when an extension's permissions change. The details are an
+ // UpdatedExtensionPermissionsInfo, and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
+
+ // Sent immediately before new extensions are installed or existing
+ // extensions are updated. The details are an InstalledExtensionInfo, and the
+ // source is a BrowserContext*.
+ //
+ // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
+ NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
+
+ // An error occured during extension install. The details are a string with
+ // details about why the install failed.
+ NOTIFICATION_EXTENSION_INSTALL_ERROR,
+
+ // Sent when an extension has been uninstalled. The details are an Extension,
+ // and the source is a BrowserContext*.
+ //
+ // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
+ NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
+
+ // Sent when an extension uninstall is not allowed because the extension is
+ // not user manageable. The details are an Extension, and the source is a
+ // BrowserContext*.
+ NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
+
+ // Sent when an extension is unloaded. This happens when an extension is
+ // uninstalled or disabled. The details are an UnloadedExtensionInfo, and the
+ // source is a BrowserContext*.
+ //
+ // Note that when this notification is sent, the ExtensionService and the
+ // ExtensionRegistry have already removed the extension from their internal
+ // state.
+ //
+ // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
+ NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+
+ // Sent when an Extension object is removed from ExtensionService. This
+ // can happen when an extension is uninstalled, upgraded, or blacklisted,
+ // including all cases when the Extension is deleted. The details are an
+ // Extension, and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_REMOVED,
+
+ // Sent after a new ExtensionHost* is created. The details are
+ // an ExtensionHost* and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_HOST_CREATED,
+
+ // Sent before an ExtensionHost* is destroyed. The details are
+ // an ExtensionHost* and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_HOST_DESTROYED,
+
+ // Sent by an ExtensionHost* when it has finished its initial page load,
+ // including any external resources.
+ // The details are an ExtensionHost* and the source is a BrowserContext*.
+ NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
+
+ // Sent by an ExtensionHost* when its render view requests closing through
+ // window.close(). The details are an ExtensionHost* and the source is a
+ // BrowserContext*.
+ NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+
+ // Sent when extension render process ends (whether it crashes or closes). The
+ // details are an ExtensionHost* and the source is a BrowserContext*. Not sent
+ // during browser shutdown.
+ NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
+
+ // Sent when a background page is ready so other components can load.
+ NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
+
+ // Sent when a browser action's state has changed. The source is the
+ // ExtensionAction* that changed. The details are the BrowserContext* that the
+ // browser action belongs to.
+ NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
+
+ // Sent when the count of page actions has changed. Note that some of them
+ // may not apply to the current page. The source is a LocationBar*. There
+ // are no details.
+ NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
+
+ // Sent when a browser action's visibility has changed. The source is the
+ // ExtensionPrefs* that changed, and the details are a std::string with the
+ // extension's ID.
+ NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
+
+ // Sent when a page action's visibility has changed. The source is the
+ // ExtensionAction* that changed. The details are a WebContents*.
+ NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
+
+ // Sent when a system indicator action's state has changed. The source is the
+ // BrowserContext* that the browser action belongs to. The details are the
+ // ExtensionAction* that changed.
+ NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
+
+ // Sent when an extension command has been removed. The source is the
+ // BrowserContext* and the details is a std::pair of two std::string objects
+ // (an extension ID and the name of the command being removed).
+ NOTIFICATION_EXTENSION_COMMAND_REMOVED,
+
+ // Sent when an extension command has been added. The source is the
+ // BrowserContext* and the details is a std::pair of two std::string objects
+ // (an extension ID and the name of the command being added).
+ NOTIFICATION_EXTENSION_COMMAND_ADDED,
+
+ // Sent when an extension command shortcut for a browser action is activated
+ // on Mac. The source is the BrowserContext* and the details is a std::pair of
+ // a std::string containing an extension ID and a gfx::NativeWindow for the
+ // associated window.
+ NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC,
+
+ // Sent when an extension command shortcut for a page action is activated
+ // on Mac. The source is the BrowserContext* and the details is a std::pair of
+ // a
+ // std::string containing an extension ID and a gfx::NativeWindow for the
+ // associated window.
+ NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC,
+
+ // A new extension RenderViewHost has been registered. The details are
+ // the RenderViewHost*.
+ NOTIFICATION_EXTENSION_VIEW_REGISTERED,
+
+ // An extension RenderViewHost has been unregistered. The details are
+ // the RenderViewHost*.
+ NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
+
+ // Sent by an extension to notify the browser about the results of a unit
+ // test.
+ NOTIFICATION_EXTENSION_TEST_PASSED,
+ NOTIFICATION_EXTENSION_TEST_FAILED,
+
+ // Sent by extension test javascript code, typically in a browser test. The
+ // sender is a std::string representing the extension id, and the details
+ // are a std::string with some message. This is particularly useful when you
+ // want to have C++ code wait for javascript code to do something.
+ NOTIFICATION_EXTENSION_TEST_MESSAGE,
+
+ // Sent when an bookmarks extensions API function was successfully invoked.
+ // The source is the id of the extension that invoked the function, and the
+ // details are a pointer to the const BookmarksFunction in question.
+ NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
+
+ // Sent when a downloads extensions API event is fired. The source is an
+ // ExtensionDownloadsEventRouter::NotificationSource, and the details is a
+ // std::string containing json. Used for testing.
+ NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
+
+ // Sent when an omnibox extension has sent back omnibox suggestions. The
+ // source is the BrowserContext*, and the details are an
+ // extensions::api::omnibox::SendSuggestions::Params object.
+ NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
+
+ // Sent when the user accepts the input in an extension omnibox keyword
+ // session. The source is the BrowserContext*.
+ NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
+
+ // Sent when an omnibox extension has updated the default suggestion. The
+ // source is the BrowserContext*.
+ NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
+
+ // Sent when the extension updater starts checking for updates to installed
+ // extensions. The source is a BrowserContext*, and there are no details.
+ NOTIFICATION_EXTENSION_UPDATING_STARTED,
+
+ // The extension updater found an update and will attempt to download and
+ // install it. The source is a BrowserContext*, and the details are an
+ // extensions::UpdateDetails object with the extension id and version of the
+ // found update.
+ NOTIFICATION_EXTENSION_UPDATE_FOUND,
+
+ // Sent when there are new user scripts available. The details are a
+ // pointer to SharedMemory containing the new scripts.
+ NOTIFICATION_USER_SCRIPTS_UPDATED,
+ NOTIFICATION_EXTENSIONS_END
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index d111d62..5ba8c13 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -13,7 +13,6 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
@@ -33,6 +32,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager_delegate.h"
#include "extensions/browser/process_manager_observer.h"
#include "extensions/browser/view_type_utils.h"
@@ -94,7 +94,7 @@ bool IsFrameInExtensionHost(ExtensionHost* extension_host,
void OnRenderViewHostUnregistered(BrowserContext* context,
RenderViewHost* render_view_host) {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
+ extensions::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
content::Source<BrowserContext>(context),
content::Details<RenderViewHost>(render_view_host));
}
@@ -248,16 +248,20 @@ ProcessManager::ProcessManager(BrowserContext* context,
weak_ptr_factory_(this) {
// ExtensionRegistry is shared between incognito and regular contexts.
DCHECK_EQ(original_context, extension_registry_->browser_context());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context));
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::Source<BrowserContext>(original_context));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::Source<BrowserContext>(original_context));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::Source<BrowserContext>(context));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
content::Source<BrowserContext>(context));
registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
content::NotificationService::AllSources());
@@ -653,14 +657,14 @@ void ProcessManager::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSIONS_READY: {
+ case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
// TODO(jamescook): Convert this to use ExtensionSystem::ready() instead
// of a notification.
MaybeCreateStartupBackgroundHosts();
break;
}
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
BrowserContext* context = content::Source<BrowserContext>(source).ptr();
ExtensionSystem* system = ExtensionSystem::Get(context);
if (system->ready().is_signaled()) {
@@ -672,7 +676,7 @@ void ProcessManager::Observe(int type,
break;
}
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
const Extension* extension =
content::Details<UnloadedExtensionInfo>(details)->extension;
for (ExtensionHostSet::iterator iter = background_hosts_.begin();
@@ -687,7 +691,7 @@ void ProcessManager::Observe(int type,
break;
}
- case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
if (background_hosts_.erase(host)) {
ClearBackgroundPageData(host->extension()->id());
@@ -697,7 +701,7 @@ void ProcessManager::Observe(int type,
break;
}
- case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
+ case extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
if (host->extension_host_type() == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
CloseBackgroundHost(host);
@@ -741,7 +745,7 @@ void ProcessManager::Observe(int type,
// RegisterRenderViewHost is called too early (before the process is
// available), so we need to wait until now to notify.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
+ extensions::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
content::Source<BrowserContext>(GetBrowserContext()),
content::Details<RenderViewHost>(contents->GetRenderViewHost()));
break;
@@ -802,10 +806,10 @@ void ProcessManager::MaybeCreateStartupBackgroundHosts() {
ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext());
if (registrar_.IsRegistered(
this,
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context))) {
registrar_.Remove(this,
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context));
}
}
@@ -898,7 +902,8 @@ IncognitoProcessManager::IncognitoProcessManager(
// load the background pages of the spanning extensions. This process
// manager need only worry about the split mode extensions, which is handled
// in the NOTIFICATION_BROWSER_WINDOW_READY notification handler.
- registrar_.Remove(this, chrome::NOTIFICATION_EXTENSIONS_READY,
+ registrar_.Remove(this,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context));
}
diff --git a/extensions/browser/process_manager_unittest.cc b/extensions/browser/process_manager_unittest.cc
index 3848d1c..e04b0d3 100644
--- a/extensions/browser/process_manager_unittest.cc
+++ b/extensions/browser/process_manager_unittest.cc
@@ -4,7 +4,6 @@
#include "extensions/browser/process_manager.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/site_instance.h"
@@ -12,6 +11,7 @@
#include "content/public/test/test_browser_context.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_test.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager_delegate.h"
#include "extensions/browser/test_extensions_browser_client.h"
@@ -108,16 +108,17 @@ TEST_F(ProcessManagerTest, ExtensionNotificationRegistration) {
// It observes other notifications from this context.
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
original_context()));
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
original_context()));
+ EXPECT_TRUE(
+ IsRegistered(manager1.get(),
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ original_context()));
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- original_context()));
- EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
original_context()));
// Test for an incognito context ProcessManager.
@@ -132,18 +133,19 @@ TEST_F(ProcessManagerTest, ExtensionNotificationRegistration) {
// Some notifications are observed for the original context.
EXPECT_TRUE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
original_context()));
// Some notifications are observed for the incognito context.
EXPECT_TRUE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
incognito_context()));
// Some are not observed at all.
- EXPECT_FALSE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSIONS_READY,
- original_context()));
+ EXPECT_FALSE(
+ IsRegistered(manager2.get(),
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
+ original_context()));
}
// Test that startup background hosts are created when the extension system
@@ -159,7 +161,7 @@ TEST_F(ProcessManagerTest, CreateBackgroundHostsOnExtensionsReady) {
// Simulate the extension system becoming ready.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_TRUE(manager->startup_background_hosts_created_for_test());
@@ -192,7 +194,7 @@ TEST_F(ProcessManagerTest, CreateBackgroundHostsDeferred) {
// The extension system becoming ready still doesn't create the hosts.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_FALSE(manager->startup_background_hosts_created_for_test());
@@ -217,7 +219,7 @@ TEST_F(ProcessManagerTest, IsBackgroundHostAllowed) {
// The extension system becoming ready still doesn't create the hosts.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_FALSE(manager->startup_background_hosts_created_for_test());
diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp
index 021e21a..bcfaee8 100644
--- a/extensions/extensions.gyp
+++ b/extensions/extensions.gyp
@@ -451,6 +451,7 @@
'browser/lazy_background_task_queue.h',
'browser/management_policy.cc',
'browser/management_policy.h',
+ 'browser/notification_types.h',
'browser/pref_names.cc',
'browser/pref_names.h',
'browser/process_manager.cc',
diff --git a/extensions/shell/DEPS b/extensions/shell/DEPS
index ffa7287..83649ba 100644
--- a/extensions/shell/DEPS
+++ b/extensions/shell/DEPS
@@ -1,6 +1,7 @@
include_rules = [
# The apps module has dependencies on chrome.
"-apps",
+
# Individual subdirectories should have their own DEPS that include
# their allowed directories.
"-extensions/shell",
@@ -17,7 +18,4 @@ include_rules = [
"+grit/extensions_resources.h",
# Real DEPS go in subdirectories, for example extensions/shell/browser/DEPS.
- # Temporary exceptions for app_shell bring-up go here.
- # TODO(jamescook): Remove these. http://crbug.com/305404
- "!chrome/browser/chrome_notification_types.h",
]
diff --git a/extensions/shell/browser/shell_browsertest.cc b/extensions/shell/browser/shell_browsertest.cc
index 9520691..271ff08 100644
--- a/extensions/shell/browser/shell_browsertest.cc
+++ b/extensions/shell/browser/shell_browsertest.cc
@@ -5,9 +5,9 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/extension_paths.h"
#include "extensions/shell/test/shell_test.h"
@@ -18,7 +18,7 @@ IN_PROC_BROWSER_TEST_F(AppShellTest, Basic) {
base::FilePath test_data_dir;
content::WindowedNotificationObserver test_pass_observer(
- chrome::NOTIFICATION_EXTENSION_TEST_PASSED,
+ extensions::NOTIFICATION_EXTENSION_TEST_PASSED,
content::NotificationService::AllSources());
PathService::Get(extensions::DIR_TEST_DATA, &test_data_dir);
diff --git a/extensions/shell/browser/shell_extension_system.cc b/extensions/shell/browser/shell_extension_system.cc
index db14d32..8c20401 100644
--- a/extensions/shell/browser/shell_extension_system.cc
+++ b/extensions/shell/browser/shell_extension_system.cc
@@ -8,7 +8,6 @@
#include "base/file_util.h"
#include "base/files/file_path.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@@ -20,6 +19,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/lazy_background_task_queue.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
@@ -66,14 +66,14 @@ bool ShellExtensionSystem::LoadApp(const base::FilePath& app_dir) {
RegisterExtensionWithRequestContexts(extension_);
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::Source<BrowserContext>(browser_context_),
content::Details<const Extension>(extension_));
// Inform the rest of the extensions system to start.
ready_.Signal();
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(browser_context_),
content::NotificationService::NoDetails());
return true;