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
This commit is contained in:
apps
app_lifetime_monitor.ccapp_load_service.ccapp_restore_service_browsertest.ccapp_window.ccsaved_files_service.cc
chrome
browser
apps
app_browsertest.ccephemeral_app_browsertest.ccephemeral_app_service.ccephemeral_app_service_browsertest.ccevent_page_browsertest.cc
autocomplete
background
chrome_notification_types.hchromeos
extensions
device_local_account_external_policy_loader_unittest.ccexternal_cache.ccinput_method_apitest_chromeos.ccinput_view_browsertest.ccinstall_limiter.cc
file_manager
policy
content_settings
devtools
download
extensions
api
bluetooth
bookmarks
commands
developer_private
downloads
enterprise_platform_keys
extension_action
image_writer_private
management
networking_private
notifications
omnibox
runtime
screenlock_private
system_indicator
updater
user_script_listener.ccuser_script_listener_unittest.ccuser_script_master.ccuser_script_master_unittest.ccwebstore_installer.ccwebstore_startup_installer_browsertest.ccfirst_run
infobars
notifications
performance_monitor
policy
supervised_user
sync
glue
test
themes
ui
app_list
ash
launcher
cocoa
extensions
browser_action_button.mmbrowser_actions_controller.mmextension_installed_bubble_controller.mmextension_keybinding_registry_cocoa.mmextension_popup_controller.mm
location_bar
extensions
panels
views
extensions
location_bar
toolbar
webui
test
extensions
@ -10,6 +10,7 @@
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
|
||||
namespace apps {
|
||||
@ -19,12 +20,12 @@ using extensions::ExtensionHost;
|
||||
|
||||
AppLifetimeMonitor::AppLifetimeMonitor(Profile* profile)
|
||||
: profile_(profile) {
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_APP_TERMINATING,
|
||||
content::NotificationService::AllSources());
|
||||
@ -50,7 +51,7 @@ void AppLifetimeMonitor::Observe(int type,
|
||||
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: {
|
||||
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
|
||||
const Extension* extension = host->extension();
|
||||
if (!extension || !extension->is_platform_app())
|
||||
@ -60,7 +61,7 @@ void AppLifetimeMonitor::Observe(int type,
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
|
||||
const Extension* extension = host->extension();
|
||||
if (!extension || !extension->is_platform_app())
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "apps/app_restore_service.h"
|
||||
#include "apps/app_window_registry.h"
|
||||
#include "apps/launcher.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/unpacked_installer.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
|
||||
using extensions::Extension;
|
||||
@ -33,12 +33,12 @@ AppLoadService::PostReloadAction::PostReloadAction()
|
||||
|
||||
AppLoadService::AppLoadService(Profile* profile)
|
||||
: profile_(profile) {
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
AppLoadService::~AppLoadService() {}
|
||||
@ -85,7 +85,7 @@ void AppLoadService::Observe(int type,
|
||||
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: {
|
||||
extensions::ExtensionHost* host =
|
||||
content::Details<extensions::ExtensionHost>(details).ptr();
|
||||
const Extension* extension = host->extension();
|
||||
@ -116,7 +116,7 @@ void AppLoadService::Observe(int type,
|
||||
post_reload_actions_.erase(it);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
const extensions::UnloadedExtensionInfo* unload_info =
|
||||
content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
|
||||
if (!unload_info->extension->is_platform_app())
|
||||
|
@ -6,13 +6,13 @@
|
||||
#include "apps/app_restore_service_factory.h"
|
||||
#include "apps/saved_files_service.h"
|
||||
#include "chrome/browser/apps/app_browsertest_util.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/file_system/file_system_api.h"
|
||||
#include "chrome/browser/extensions/extension_test_message_listener.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
|
||||
using extensions::Extension;
|
||||
@ -29,7 +29,7 @@ namespace apps {
|
||||
// Tests that a running app is recorded in the preferences as such.
|
||||
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, RunningAppsAreRecorded) {
|
||||
content::WindowedNotificationObserver extension_suspended(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
const Extension* extension = LoadExtension(
|
||||
@ -111,7 +111,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ActiveAppsAreRecorded) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) {
|
||||
content::WindowedNotificationObserver extension_suspended(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
base::ScopedTempDir temp_directory;
|
||||
@ -151,7 +151,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_FileAccessIsRestored) {
|
||||
content::WindowedNotificationObserver extension_suspended(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
base::ScopedTempDir temp_directory;
|
||||
|
@ -39,6 +39,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/view_type_utils.h"
|
||||
#include "extensions/common/extension.h"
|
||||
@ -326,7 +327,7 @@ void AppWindow::Init(const GURL& url,
|
||||
extensions::ExtensionsBrowserClient* client =
|
||||
extensions::ExtensionsBrowserClient::Get();
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<content::BrowserContext>(
|
||||
client->GetOriginalContext(browser_context_)));
|
||||
// Close when the browser process is exiting.
|
||||
@ -334,10 +335,11 @@ void AppWindow::Init(const GURL& url,
|
||||
chrome::NOTIFICATION_APP_TERMINATING,
|
||||
content::NotificationService::AllSources());
|
||||
// Update the app menu if an ephemeral app becomes installed.
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::Source<content::BrowserContext>(
|
||||
client->GetOriginalContext(browser_context_)));
|
||||
registrar_.Add(
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::Source<content::BrowserContext>(
|
||||
client->GetOriginalContext(browser_context_)));
|
||||
|
||||
app_window_contents_->LoadContents(new_params.creator_process_id);
|
||||
|
||||
@ -996,7 +998,7 @@ void AppWindow::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: {
|
||||
const extensions::Extension* unloaded_extension =
|
||||
content::Details<extensions::UnloadedExtensionInfo>(details)
|
||||
->extension;
|
||||
@ -1004,7 +1006,7 @@ void AppWindow::Observe(int type,
|
||||
native_app_window_->Close();
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
const extensions::Extension* installed_extension =
|
||||
content::Details<const extensions::InstalledExtensionInfo>(details)
|
||||
->extension;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/extension_util.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/permissions/api_permission.h"
|
||||
#include "extensions/common/permissions/permission_set.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
@ -197,7 +198,7 @@ SavedFilesService::SavedFilesService(Profile* profile)
|
||||
: extension_id_to_saved_files_deleter_(&extension_id_to_saved_files_),
|
||||
profile_(profile) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_APP_TERMINATING,
|
||||
@ -210,7 +211,7 @@ void SavedFilesService::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
|
||||
const Extension* extension = host->extension();
|
||||
if (extension) {
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/pref_names.h"
|
||||
#include "extensions/common/api/app_runtime.h"
|
||||
#include "net/test/embedded_test_server/embedded_test_server.h"
|
||||
@ -938,9 +939,10 @@ namespace {
|
||||
class CheckExtensionInstalledObserver : public content::NotificationObserver {
|
||||
public:
|
||||
CheckExtensionInstalledObserver() : seen_(false) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
bool seen() const {
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "extensions/browser/extension_registry_observer.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/extension_util.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/process_manager.h"
|
||||
#include "extensions/browser/uninstall_reason.h"
|
||||
#include "extensions/common/extension.h"
|
||||
@ -202,7 +203,7 @@ const Extension* EphemeralAppTestBase::UpdateEphemeralApp(
|
||||
// Update the ephemeral app and wait for the update to finish.
|
||||
extensions::CrxInstaller* crx_installer = NULL;
|
||||
content::WindowedNotificationObserver windowed_observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(crx_installer));
|
||||
ExtensionService* service =
|
||||
ExtensionSystem::Get(profile())->extension_service();
|
||||
@ -223,7 +224,7 @@ void EphemeralAppTestBase::PromoteEphemeralApp(
|
||||
|
||||
void EphemeralAppTestBase::CloseApp(const std::string& app_id) {
|
||||
content::WindowedNotificationObserver event_page_destroyed_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::Source<Profile>(profile()));
|
||||
|
||||
EXPECT_EQ(1U, GetAppWindowCountForApp(app_id));
|
||||
@ -238,7 +239,7 @@ void EphemeralAppTestBase::EvictApp(const std::string& app_id) {
|
||||
// Uninstall the app, which is what happens when ephemeral apps get evicted
|
||||
// from the cache.
|
||||
content::WindowedNotificationObserver uninstalled_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile()));
|
||||
|
||||
ExtensionService* service =
|
||||
@ -697,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest,
|
||||
|
||||
// The delayed installation will occur when the ephemeral app is closed.
|
||||
content::WindowedNotificationObserver installed_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile()));
|
||||
InstallObserver installed_observer(profile());
|
||||
CloseApp(app_id);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/extension_util.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/uninstall_reason.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
@ -63,7 +64,8 @@ EphemeralAppService::EphemeralAppService(Profile* profile)
|
||||
return;
|
||||
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(profile_));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile_));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
|
||||
content::Source<Profile>(profile_));
|
||||
@ -113,7 +115,7 @@ void EphemeralAppService::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSIONS_READY: {
|
||||
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
|
||||
Init();
|
||||
break;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/manifest.h"
|
||||
|
||||
using extensions::Extension;
|
||||
@ -83,7 +84,7 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppServiceBrowserTest,
|
||||
|
||||
// Perform garbage collection.
|
||||
content::WindowedNotificationObserver uninstall_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(browser()->profile()));
|
||||
GarbageCollectEphemeralApps();
|
||||
uninstall_signal.Wait();
|
||||
|
@ -3,11 +3,11 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/apps/app_browsertest_util.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_test_message_listener.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/browser_test.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
using extensions::Extension;
|
||||
using extensions::PlatformAppBrowserTest;
|
||||
@ -22,7 +22,7 @@ class AppEventPageTest : public PlatformAppBrowserTest {
|
||||
ASSERT_TRUE(extension);
|
||||
|
||||
content::WindowedNotificationObserver event_page_suspended(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
// Close the app window.
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h"
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/omnibox/omnibox_api.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/extension_util.h"
|
||||
@ -13,6 +12,7 @@
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace omnibox_api = extensions::api::omnibox;
|
||||
|
||||
@ -28,15 +28,16 @@ KeywordExtensionsDelegateImpl::KeywordExtensionsDelegateImpl(
|
||||
// Extension suggestions always come from the original profile, since that's
|
||||
// where extensions run. We use the input ID to distinguish whether the
|
||||
// suggestions are meant for us.
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
|
||||
content::Source<Profile>(profile()->GetOriginalProfile()));
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
|
||||
content::Source<Profile>(profile()->GetOriginalProfile()));
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
|
||||
content::Source<Profile>(profile()->GetOriginalProfile()));
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
|
||||
content::Source<Profile>(profile()));
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
|
||||
content::Source<Profile>(profile()));
|
||||
}
|
||||
|
||||
KeywordExtensionsDelegateImpl::~KeywordExtensionsDelegateImpl() {
|
||||
@ -123,7 +124,7 @@ void KeywordExtensionsDelegateImpl::Observe(
|
||||
const AutocompleteInput& input = extension_suggest_last_input_;
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED:
|
||||
case extensions::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED:
|
||||
// Input has been accepted, so we're done with this input session. Ensure
|
||||
// we don't send the OnInputCancelled event, or handle any more stray
|
||||
// suggestions_ready events.
|
||||
@ -131,7 +132,8 @@ void KeywordExtensionsDelegateImpl::Observe(
|
||||
current_input_id_ = 0;
|
||||
return;
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED
|
||||
: {
|
||||
// It's possible to change the default suggestion while not in an editing
|
||||
// session.
|
||||
base::string16 keyword, remaining_input;
|
||||
@ -148,7 +150,7 @@ void KeywordExtensionsDelegateImpl::Observe(
|
||||
return;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY: {
|
||||
case extensions::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY: {
|
||||
const omnibox_api::SendSuggestions::Params& suggestions =
|
||||
*content::Details<
|
||||
omnibox_api::SendSuggestions::Params>(details).ptr();
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
@ -83,7 +84,8 @@ ShortcutsBackend::ShortcutsBackend(Profile* profile, bool suppress_db)
|
||||
// |profile| can be NULL in tests.
|
||||
if (profile) {
|
||||
notification_registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
notification_registrar_.Add(
|
||||
this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
|
||||
@ -175,7 +177,7 @@ void ShortcutsBackend::Observe(int type,
|
||||
if (!initialized())
|
||||
return;
|
||||
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED) {
|
||||
if (type == extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED) {
|
||||
// When an extension is unloaded, we want to remove any Shortcuts associated
|
||||
// with it.
|
||||
DeleteShortcutsWithURL(content::Details<extensions::UnloadedExtensionInfo>(
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
|
||||
#include "chrome/browser/autocomplete/shortcuts_backend.h"
|
||||
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/history/history_service.h"
|
||||
#include "chrome/browser/history/in_memory_url_index.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
@ -33,6 +32,7 @@
|
||||
#include "components/metrics/proto/omnibox_event.pb.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_browser_thread.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_builder.h"
|
||||
#include "extensions/common/value_builder.h"
|
||||
@ -840,7 +840,7 @@ TEST_F(ShortcutsProviderTest, Extension) {
|
||||
extensions::UnloadedExtensionInfo details(
|
||||
extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<Profile>(&profile_),
|
||||
content::Details<extensions::UnloadedExtensionInfo>(&details));
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/extension_util.h"
|
||||
#include "extensions/browser/image_loader.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_icon_set.h"
|
||||
#include "extensions/common/extension_resource.h"
|
||||
@ -179,16 +180,16 @@ BackgroundApplicationListModel::BackgroundApplicationListModel(Profile* profile)
|
||||
ready_(false) {
|
||||
DCHECK(profile_);
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_BACKGROUND_CONTENTS_SERVICE_CHANGED,
|
||||
@ -353,7 +354,7 @@ void BackgroundApplicationListModel::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
if (type == chrome::NOTIFICATION_EXTENSIONS_READY) {
|
||||
if (type == extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED) {
|
||||
Update();
|
||||
ready_ = true;
|
||||
return;
|
||||
@ -364,14 +365,14 @@ void BackgroundApplicationListModel::Observe(
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
OnExtensionLoaded(content::Details<Extension>(details).ptr());
|
||||
break;
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
|
||||
OnExtensionUnloaded(
|
||||
content::Details<UnloadedExtensionInfo>(details)->extension);
|
||||
break;
|
||||
case chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED:
|
||||
OnExtensionPermissionsUpdated(
|
||||
content::Details<UpdatedExtensionPermissionsInfo>(details)->extension,
|
||||
content::Details<UpdatedExtensionPermissionsInfo>(details)->reason,
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/image_loader.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_icon_set.h"
|
||||
@ -309,7 +310,8 @@ BackgroundContentsService::GetBackgroundContents() const
|
||||
|
||||
void BackgroundContentsService::StartObserving(Profile* profile) {
|
||||
// On startup, load our background pages after extension-apps have loaded.
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
|
||||
// Track the lifecycle of all BackgroundContents in the system to allow us
|
||||
@ -331,7 +333,8 @@ void BackgroundContentsService::StartObserving(Profile* profile) {
|
||||
|
||||
// Track when the extensions crash so that the user can be notified
|
||||
// about it, and the crashed contents can be restarted.
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED,
|
||||
content::Source<Profile>(profile));
|
||||
@ -345,7 +348,7 @@ void BackgroundContentsService::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSIONS_READY: {
|
||||
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
LoadBackgroundContentsFromManifests(profile);
|
||||
LoadBackgroundContentsFromPrefs(profile);
|
||||
@ -385,7 +388,7 @@ void BackgroundContentsService::Observe(
|
||||
RegisterBackgroundContents(bgcontents);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED:
|
||||
case chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED: {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
const Extension* extension = NULL;
|
||||
|
@ -299,7 +299,8 @@ void BackgroundModeManager::RegisterProfile(Profile* profile) {
|
||||
// Check for the presence of background apps after all extensions have been
|
||||
// loaded, to handle the case where an extension has been manually removed
|
||||
// while Chrome was not running.
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
|
||||
bmd->applications_->AddObserver(this);
|
||||
@ -332,7 +333,7 @@ void BackgroundModeManager::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSIONS_READY:
|
||||
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED:
|
||||
// Extensions are loaded, so we don't need to manually keep the browser
|
||||
// process alive any more when running in no-startup-window mode.
|
||||
DecrementKeepAliveCountForStartup();
|
||||
|
@ -6,12 +6,12 @@
|
||||
#define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace chrome {
|
||||
|
||||
enum NotificationType {
|
||||
NOTIFICATION_CHROME_START = content::NOTIFICATION_CONTENT_END,
|
||||
NOTIFICATION_CHROME_START = extensions::NOTIFICATION_EXTENSIONS_END,
|
||||
|
||||
// Browser-window ----------------------------------------------------------
|
||||
|
||||
@ -363,210 +363,6 @@ enum NotificationType {
|
||||
// are all source and no details.
|
||||
NOTIFICATION_SESSION_END,
|
||||
|
||||
// User Scripts ------------------------------------------------------------
|
||||
|
||||
// Sent when there are new user scripts available. The details are a
|
||||
// pointer to SharedMemory containing the new scripts.
|
||||
NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
|
||||
// Extensions --------------------------------------------------------------
|
||||
|
||||
// Sent when a CrxInstaller finishes. Source is the CrxInstaller that
|
||||
// finished. The details are the extension which was installed.
|
||||
NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
|
||||
// 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 Profile.
|
||||
NOTIFICATION_EXTENSIONS_READY,
|
||||
|
||||
// DEPRECATED: Use ExtensionRegistry::AddObserver instead.
|
||||
//
|
||||
// Sent when a new extension is loaded. The details are an Extension, and
|
||||
// the source is a Profile.
|
||||
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 NOTIFICATION_EXTENSION_LOADED_DEPRECATED. 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 Profile.
|
||||
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 Profile*.
|
||||
NOTIFICATION_EXTENSION_UPDATE_DISABLED,
|
||||
|
||||
// Sent when an extension's permissions change. The details are an
|
||||
// UpdatedExtensionPermissionsInfo, and the source is a Profile.
|
||||
NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
|
||||
// DEPRECATED: Use ExtensionRegistry::AddObserver instead.
|
||||
//
|
||||
// Sent immediately before new extensions are installed or existing
|
||||
// extensions are updated. The details are an InstalledExtensionInfo, and the
|
||||
// source is a Profile.
|
||||
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,
|
||||
|
||||
// DEPRECATED: Use ExtensionRegistry::AddObserver instead.
|
||||
//
|
||||
// Sent when an extension has been uninstalled. The details are an Extension,
|
||||
// and the source is a Profile.
|
||||
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
|
||||
// Profile.
|
||||
NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
|
||||
|
||||
// DEPRECATED: Use ExtensionRegistry::AddObserver instead.
|
||||
//
|
||||
// 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 Profile.
|
||||
//
|
||||
// Note that when this notification is sent, ExtensionService has already
|
||||
// removed the extension from its internal state.
|
||||
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 Profile.
|
||||
NOTIFICATION_EXTENSION_REMOVED,
|
||||
|
||||
// Sent after a new ExtensionHost is created. The details are
|
||||
// an ExtensionHost* and the source is a Profile*.
|
||||
NOTIFICATION_EXTENSION_HOST_CREATED,
|
||||
|
||||
// Sent before an ExtensionHost is destroyed. The details are
|
||||
// an ExtensionHost* and the source is a Profile*.
|
||||
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 Profile*.
|
||||
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
|
||||
// Profile*.
|
||||
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 Profile*. 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 Profile* 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
|
||||
// Profile* 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 profile
|
||||
// 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 profile
|
||||
// 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 profile 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 profile 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 profile, 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 profile.
|
||||
NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
|
||||
|
||||
// Sent when an omnibox extension has updated the default suggestion. The
|
||||
// source is the profile.
|
||||
NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
|
||||
|
||||
// Sent when the extension updater starts checking for updates to installed
|
||||
// extensions. The source is a Profile, 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 Profile, and the details are an
|
||||
// extensions::UpdateDetails object with the extension id and version of the
|
||||
// found update.
|
||||
NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
|
||||
// Upgrade notifications ---------------------------------------------------
|
||||
|
||||
// Sent when Chrome believes an update has been installed and available for
|
||||
@ -799,14 +595,14 @@ enum NotificationType {
|
||||
// Sent when the applications in the NTP app launcher have been reordered.
|
||||
// The details, if not NoDetails, is the std::string ID of the extension that
|
||||
// was moved.
|
||||
NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
|
||||
NOTIFICATION_APP_LAUNCHER_REORDERED,
|
||||
|
||||
// Sent when an app is installed and an NTP has been shown. Source is the
|
||||
// WebContents that was shown, and Details is the string ID of the extension
|
||||
// which was installed.
|
||||
NOTIFICATION_APP_INSTALLED_TO_NTP,
|
||||
|
||||
// Similar to NOTIFICATION_APP_INSTALLED_TO_NTP but used to nofity ash AppList
|
||||
// Similar to NOTIFICATION_APP_INSTALLED_TO_NTP but used to notify ash AppList
|
||||
// about installed app. Source is the profile in which the app is installed
|
||||
// and Details is the string ID of the extension.
|
||||
NOTIFICATION_APP_INSTALLED_TO_APPLIST,
|
||||
@ -819,6 +615,7 @@ enum NotificationType {
|
||||
// generated when the metro app has connected to the browser IPC channel.
|
||||
// Used only on Windows.
|
||||
NOTIFICATION_ASH_SESSION_STARTED,
|
||||
|
||||
// Sent when the Ash session ended. Currently this means the metro app exited.
|
||||
// Used only on Windows.
|
||||
NOTIFICATION_ASH_SESSION_ENDED,
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/values.h"
|
||||
#include "base/version.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/external_provider_impl.h"
|
||||
#include "chrome/browser/extensions/updater/extension_downloader.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "content/public/test/test_browser_thread_bundle.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/external_provider_interface.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/manifest.h"
|
||||
#include "net/url_request/test_url_fetcher_factory.h"
|
||||
@ -252,7 +252,7 @@ TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, ForceInstallListSet) {
|
||||
|
||||
// Wait for the manifest to be parsed.
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
|
||||
// Verify that the downloader is attempting to download a CRX file.
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/values.h"
|
||||
#include "base/version.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/crx_installer.h"
|
||||
#include "chrome/browser/extensions/external_provider_impl.h"
|
||||
#include "chrome/browser/extensions/updater/extension_downloader.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
|
||||
@ -44,7 +44,7 @@ ExternalCache::ExternalCache(const base::FilePath& cache_dir,
|
||||
weak_ptr_factory_(this) {
|
||||
notification_registrar_.Add(
|
||||
this,
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ void ExternalCache::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
case extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
extensions::CrxInstaller* installer =
|
||||
content::Source<extensions::CrxInstaller>(source).ptr();
|
||||
OnDamagedFileDetected(installer->source_file());
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/extensions/input_method_event_router.h"
|
||||
#include "chrome/browser/chromeos/input_method/input_method_util.h"
|
||||
#include "chromeos/ime/extension_ime_util.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/common/switches.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace {
|
||||
@ -31,7 +31,8 @@ const char kBackgroundReady[] = "ready";
|
||||
class TestListener : public content::NotificationObserver {
|
||||
public:
|
||||
explicit TestListener() {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/file_util.h"
|
||||
@ -62,7 +63,7 @@ class InputViewBrowserTest : public VirtualKeyboardBrowserTest {
|
||||
extensions::CrxInstaller::CreateSilent(service);
|
||||
|
||||
ExtensionTestNotificationObserver observer(browser());
|
||||
observer.Watch(chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
observer.Watch(extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(installer.get()));
|
||||
installer->set_allow_silent_install(true);
|
||||
installer->set_creation_flags(extensions::Extension::FROM_WEBSTORE);
|
||||
|
@ -9,11 +9,11 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/extensions/install_limiter_factory.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
@ -117,7 +117,7 @@ void InstallLimiter::CheckAndRunDeferrredInstalls() {
|
||||
void InstallLimiter::RunInstall(const scoped_refptr<CrxInstaller>& installer,
|
||||
const base::FilePath& path) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<CrxInstaller>(installer.get()));
|
||||
|
||||
installer->InstallCrx(path);
|
||||
@ -127,11 +127,9 @@ void InstallLimiter::RunInstall(const scoped_refptr<CrxInstaller>& installer,
|
||||
void InstallLimiter::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_CRX_INSTALLER_DONE, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_CRX_INSTALLER_DONE, type);
|
||||
|
||||
registrar_.Remove(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
source);
|
||||
registrar_.Remove(this, extensions::NOTIFICATION_CRX_INSTALLER_DONE, source);
|
||||
|
||||
const scoped_refptr<CrxInstaller> installer =
|
||||
content::Source<extensions::CrxInstaller>(source).ptr();
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/path_service.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
|
||||
#include "chrome/browser/chromeos/file_manager/drive_test_util.h"
|
||||
#include "chrome/browser/chromeos/file_manager/volume_manager.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "google_apis/drive/drive_api_parser.h"
|
||||
#include "google_apis/drive/test_util.h"
|
||||
#include "google_apis/drive/time_util.h"
|
||||
@ -293,11 +293,10 @@ bool InitializeDriveService(
|
||||
class BackgroundObserver {
|
||||
public:
|
||||
BackgroundObserver()
|
||||
: page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
: page_created_(extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
content::NotificationService::AllSources()),
|
||||
page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources()) {
|
||||
}
|
||||
page_closed_(extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources()) {}
|
||||
|
||||
void WaitUntilLoaded() {
|
||||
page_created_.Wait();
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
|
||||
#include "chrome/browser/chromeos/drive/file_system_interface.h"
|
||||
#include "chrome/browser/chromeos/file_manager/app_id.h"
|
||||
@ -45,6 +44,7 @@
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "google_apis/drive/drive_api_parser.h"
|
||||
#include "google_apis/drive/test_util.h"
|
||||
@ -485,13 +485,13 @@ class FileManagerTestListener : public content::NotificationObserver {
|
||||
|
||||
FileManagerTestListener() {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_PASSED,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_PASSED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_FAILED,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_FAILED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -508,12 +508,13 @@ class FileManagerTestListener : public content::NotificationObserver {
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
Message entry;
|
||||
entry.type = type;
|
||||
entry.message = type != chrome::NOTIFICATION_EXTENSION_TEST_PASSED ?
|
||||
*content::Details<std::string>(details).ptr() :
|
||||
std::string();
|
||||
entry.function = type == chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE ?
|
||||
content::Source<extensions::TestSendMessageFunction>(source).ptr() :
|
||||
NULL;
|
||||
entry.message = type != extensions::NOTIFICATION_EXTENSION_TEST_PASSED
|
||||
? *content::Details<std::string>(details).ptr()
|
||||
: std::string();
|
||||
entry.function =
|
||||
type == extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE
|
||||
? content::Source<extensions::TestSendMessageFunction>(source).ptr()
|
||||
: NULL;
|
||||
messages_.push_back(entry);
|
||||
base::MessageLoopForUI::current()->Quit();
|
||||
}
|
||||
@ -621,10 +622,10 @@ void FileManagerBrowserTestBase::RunTestMessageLoop() {
|
||||
FileManagerTestListener listener;
|
||||
while (true) {
|
||||
FileManagerTestListener::Message entry = listener.GetNextMessage();
|
||||
if (entry.type == chrome::NOTIFICATION_EXTENSION_TEST_PASSED) {
|
||||
if (entry.type == extensions::NOTIFICATION_EXTENSION_TEST_PASSED) {
|
||||
// Test succeed.
|
||||
break;
|
||||
} else if (entry.type == chrome::NOTIFICATION_EXTENSION_TEST_FAILED) {
|
||||
} else if (entry.type == extensions::NOTIFICATION_EXTENSION_TEST_FAILED) {
|
||||
// Test failed.
|
||||
ADD_FAILURE() << entry.message;
|
||||
break;
|
||||
|
@ -103,6 +103,7 @@
|
||||
#include "crypto/rsa_private_key.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/management_policy.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "grit/chromium_strings.h"
|
||||
#include "grit/generated_resources.h"
|
||||
@ -723,10 +724,10 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, ExtensionsUncached) {
|
||||
|
||||
// Start listening for app/extension installation results.
|
||||
content::WindowedNotificationObserver hosted_app_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
base::Bind(DoesInstallSuccessReferToId, kHostedAppID));
|
||||
content::WindowedNotificationObserver extension_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
base::Bind(DoesInstallFailureReferToId, kGoodExtensionID));
|
||||
|
||||
// Start login into the device-local account.
|
||||
@ -824,10 +825,10 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, ExtensionsCached) {
|
||||
|
||||
// Start listening for app/extension installation results.
|
||||
content::WindowedNotificationObserver hosted_app_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
base::Bind(DoesInstallSuccessReferToId, kHostedAppID));
|
||||
content::WindowedNotificationObserver extension_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
base::Bind(DoesInstallFailureReferToId, kGoodExtensionID));
|
||||
|
||||
// Start login into the device-local account.
|
||||
@ -1128,7 +1129,7 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, LastWindowClosedLogoutReminder) {
|
||||
installer->set_install_cause(extension_misc::INSTALL_CAUSE_USER_DOWNLOAD);
|
||||
installer->set_creation_flags(extensions::Extension::FROM_WEBSTORE);
|
||||
content::WindowedNotificationObserver app_install_observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
base::FilePath test_dir;
|
||||
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "chrome/browser/content_settings/content_settings_internal_extension_provider.h"
|
||||
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/content_settings/content_settings_rule.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/common/chrome_content_client.h"
|
||||
@ -15,6 +14,7 @@
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
@ -35,12 +35,14 @@ InternalExtensionProvider::InternalExtensionProvider(
|
||||
SetContentSettingForExtension(it->get(), CONTENT_SETTING_ALLOW);
|
||||
}
|
||||
Profile* profile = extension_service->profile();
|
||||
registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
|
||||
registrar_->Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_CREATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_->Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
registrar_->Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile));
|
||||
}
|
||||
|
||||
@ -71,7 +73,7 @@ void InternalExtensionProvider::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_CREATED: {
|
||||
const extensions::ExtensionHost* host =
|
||||
content::Details<extensions::ExtensionHost>(details).ptr();
|
||||
if (host->extension()->is_platform_app()) {
|
||||
@ -133,14 +135,14 @@ void InternalExtensionProvider::Observe(int type,
|
||||
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
const extensions::Extension* extension =
|
||||
content::Details<extensions::Extension>(details).ptr();
|
||||
if (extensions::PluginInfo::HasPlugins(extension))
|
||||
SetContentSettingForExtension(extension, CONTENT_SETTING_ALLOW);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
const UnloadedExtensionInfo& info =
|
||||
*(content::Details<UnloadedExtensionInfo>(details).ptr());
|
||||
if (extensions::PluginInfo::HasPlugins(info.extension))
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/switches.h"
|
||||
#include "net/socket/tcp_listen_socket.h"
|
||||
#include "net/test/spawned_test_server/spawned_test_server.h"
|
||||
@ -322,7 +323,7 @@ class DevToolsExtensionTest : public DevToolsSanityTest,
|
||||
{
|
||||
content::NotificationRegistrar registrar;
|
||||
registrar.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
base::CancelableClosure timeout(
|
||||
base::Bind(&TimeoutCallback, "Extension load timed out."));
|
||||
@ -345,7 +346,8 @@ class DevToolsExtensionTest : public DevToolsSanityTest,
|
||||
// this method is running.
|
||||
|
||||
content::NotificationRegistrar registrar;
|
||||
registrar.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
registrar.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
base::CancelableClosure timeout(
|
||||
base::Bind(&TimeoutCallback, "Extension host load timed out."));
|
||||
@ -373,8 +375,8 @@ class DevToolsExtensionTest : public DevToolsSanityTest,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING:
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING:
|
||||
base::MessageLoopForUI::current()->Quit();
|
||||
break;
|
||||
default:
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/download/download_completion_blocker.h"
|
||||
#include "chrome/browser/download/download_crx_util.h"
|
||||
#include "chrome/browser/download/download_file_picker.h"
|
||||
@ -47,6 +46,7 @@
|
||||
#include "content/public/browser/download_manager.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/browser/page_navigator.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "net/base/filename_util.h"
|
||||
#include "net/base/mime_util.h"
|
||||
|
||||
@ -360,7 +360,7 @@ bool ChromeDownloadManagerDelegate::ShouldOpenDownload(
|
||||
// time, Observe() will call the passed callback.
|
||||
registrar_.Add(
|
||||
this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(crx_installer.get()));
|
||||
|
||||
crx_installers_[crx_installer.get()] = callback;
|
||||
@ -669,11 +669,9 @@ void ChromeDownloadManagerDelegate::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
#if defined(ENABLE_EXTENSIONS)
|
||||
DCHECK(type == chrome::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
DCHECK(type == extensions::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
|
||||
registrar_.Remove(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
source);
|
||||
registrar_.Remove(this, extensions::NOTIFICATION_CRX_INSTALLER_DONE, source);
|
||||
|
||||
scoped_refptr<extensions::CrxInstaller> installer =
|
||||
content::Source<extensions::CrxInstaller>(source).ptr();
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api_pairing_delegate.h"
|
||||
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api_utils.h"
|
||||
#include "chrome/browser/extensions/api/bluetooth/bluetooth_private_api.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
@ -45,7 +45,7 @@ BluetoothEventRouter::BluetoothEventRouter(content::BrowserContext* context)
|
||||
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
||||
DCHECK(browser_context_);
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::Source<content::BrowserContext>(browser_context_));
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
|
||||
}
|
||||
@ -352,7 +352,7 @@ void BluetoothEventRouter::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, type);
|
||||
ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
|
||||
CleanUpForExtension(host->extension_id());
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
||||
#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
|
||||
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/bookmarks/bookmark_api_constants.h"
|
||||
#include "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h"
|
||||
#include "chrome/browser/importer/external_process_importer_host.h"
|
||||
@ -48,6 +47,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_function_dispatcher.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
#include "grit/generated_resources.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@ -156,7 +156,7 @@ bool BookmarksFunction::RunAsync() {
|
||||
bool success = RunOnReady();
|
||||
if (success) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
content::Source<const Extension>(extension()),
|
||||
content::Details<const BookmarksFunction>(this));
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/app/chrome_command_ids.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/commands/commands.h"
|
||||
#include "chrome/browser/extensions/extension_commands_global_registry.h"
|
||||
#include "chrome/browser/extensions/extension_keybinding_registry.h"
|
||||
@ -28,6 +27,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/feature_switch.h"
|
||||
#include "extensions/common/manifest_constants.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
@ -286,10 +286,10 @@ bool CommandService::AddKeybindingPref(
|
||||
std::pair<const std::string, const std::string> details =
|
||||
std::make_pair(extension_id, command_name);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED,
|
||||
extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<
|
||||
std::pair<const std::string, const std::string> >(&details));
|
||||
content::Details<std::pair<const std::string, const std::string> >(
|
||||
&details));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -804,10 +804,10 @@ void CommandService::RemoveKeybindingPrefs(const std::string& extension_id,
|
||||
std::pair<const std::string, const std::string> details =
|
||||
std::make_pair(extension_id, command_name);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED,
|
||||
extensions::NOTIFICATION_EXTENSION_COMMAND_REMOVED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<
|
||||
std::pair<const std::string, const std::string> >(&details));
|
||||
content::Details<std::pair<const std::string, const std::string> >(
|
||||
&details));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
#include "chrome/browser/extensions/api/developer_private/entry_picker.h"
|
||||
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
|
||||
@ -54,6 +53,7 @@
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/management_policy.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/view_type_utils.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension_resource.h"
|
||||
@ -193,10 +193,10 @@ DeveloperPrivateAPI::DeveloperPrivateAPI(content::BrowserContext* context)
|
||||
DeveloperPrivateEventRouter::DeveloperPrivateEventRouter(Profile* profile)
|
||||
: extension_registry_observer_(this), profile_(profile) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
|
||||
extensions::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
|
||||
content::Source<Profile>(profile_));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
|
||||
extensions::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
|
||||
content::Source<Profile>(profile_));
|
||||
|
||||
// TODO(limasdf): Use scoped_observer instead.
|
||||
@ -229,13 +229,13 @@ void DeveloperPrivateEventRouter::Observe(
|
||||
developer::EventData event_data;
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED: {
|
||||
event_data.event_type = developer::EVENT_TYPE_VIEW_UNREGISTERED;
|
||||
event_data.item_id = GetExtensionID(
|
||||
content::Details<const RenderViewHost>(details).ptr());
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_VIEW_REGISTERED: {
|
||||
event_data.event_type = developer::EVENT_TYPE_VIEW_REGISTERED;
|
||||
event_data.item_id = GetExtensionID(
|
||||
content::Details<const RenderViewHost>(details).ptr());
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/task/cancelable_task_tracker.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/download/download_danger_prompt.h"
|
||||
#include "chrome/browser/download/download_file_icon_extractor.h"
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
@ -64,6 +63,7 @@
|
||||
#include "extensions/browser/extension_function_dispatcher.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
#include "net/base/filename_util.h"
|
||||
#include "net/base/load_flags.h"
|
||||
@ -1911,7 +1911,7 @@ void ExtensionDownloadsEventRouter::DispatchEvent(
|
||||
content::Source<DownloadsNotificationSource> content_source(
|
||||
¬ification_source);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
content_source,
|
||||
content::Details<std::string>(&json_args));
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/download/download_file_icon_extractor.h"
|
||||
#include "chrome/browser/download/download_service.h"
|
||||
#include "chrome/browser/download/download_service_factory.h"
|
||||
@ -44,6 +43,7 @@
|
||||
#include "content/public/test/download_test_observer.h"
|
||||
#include "content/test/net/url_request_slow_download_job.h"
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "net/base/data_url.h"
|
||||
#include "net/base/net_util.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
@ -80,12 +80,14 @@ class DownloadsEventsListener : public content::NotificationObserver {
|
||||
public:
|
||||
DownloadsEventsListener()
|
||||
: waiting_(false) {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
virtual ~DownloadsEventsListener() {
|
||||
registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
registrar_.Remove(this,
|
||||
extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
|
||||
content::NotificationService::AllSources());
|
||||
STLDeleteElements(&events_);
|
||||
}
|
||||
@ -176,8 +178,7 @@ class DownloadsEventsListener : public content::NotificationObserver {
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT:
|
||||
{
|
||||
case extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT: {
|
||||
DownloadsNotificationSource* dns =
|
||||
content::Source<DownloadsNotificationSource>(source).ptr();
|
||||
Event* new_event = new Event(
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_apitest.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/net/nss_context.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "content/test/net/url_request_mock_http_job.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/cert/nss_cert_database.h"
|
||||
#include "policy/policy_constants.h"
|
||||
@ -160,7 +160,7 @@ class EnterprisePlatformKeysTest : public ExtensionApiTest {
|
||||
|
||||
// Set the policy and wait until the extension is installed.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
policy_provider_.UpdateChromePolicy(policy);
|
||||
observer.Wait();
|
||||
|
@ -3,8 +3,6 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/browser_action_test_util.h"
|
||||
#include "chrome/browser/extensions/extension_action.h"
|
||||
#include "chrome/browser/extensions/extension_action_icon_factory.h"
|
||||
@ -24,6 +22,7 @@
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/feature_switch.h"
|
||||
#include "grit/theme_resources.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
@ -619,7 +618,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_CloseBackgroundPage) {
|
||||
ASSERT_EQ("", action->GetBadgeText(ExtensionAction::kDefaultTabId));
|
||||
|
||||
content::WindowedNotificationObserver host_destroyed_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
// Click the browser action.
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/extension_action/extension_page_actions_api_constants.h"
|
||||
#include "chrome/browser/extensions/extension_action.h"
|
||||
#include "chrome/browser/extensions/extension_action_manager.h"
|
||||
@ -29,6 +28,7 @@
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/image_util.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/state_store.h"
|
||||
#include "extensions/common/error_utils.h"
|
||||
#include "ui/gfx/codec/png_codec.h"
|
||||
@ -308,7 +308,7 @@ void ExtensionActionAPI::SetBrowserActionVisibility(
|
||||
kBrowserActionVisible,
|
||||
new base::FundamentalValue(visible));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
content::Source<ExtensionPrefs>(prefs),
|
||||
content::Details<const std::string>(&extension_id));
|
||||
}
|
||||
@ -420,7 +420,8 @@ void ExtensionActionAPI::ExtensionActionExecuted(
|
||||
ExtensionActionStorageManager::ExtensionActionStorageManager(Profile* profile)
|
||||
: profile_(profile), extension_registry_observer_(this) {
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(profile_));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
|
||||
StateStore* storage = ExtensionSystem::Get(profile_)->state_store();
|
||||
@ -453,7 +454,7 @@ void ExtensionActionStorageManager::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED);
|
||||
DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED);
|
||||
ExtensionAction* extension_action =
|
||||
content::Source<ExtensionAction>(source).ptr();
|
||||
Profile* profile = content::Details<Profile>(details).ptr();
|
||||
@ -627,7 +628,7 @@ void ExtensionActionFunction::NotifyChange() {
|
||||
|
||||
void ExtensionActionFunction::NotifyBrowserActionChange() {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
content::Source<ExtensionAction>(extension_action_),
|
||||
content::Details<Profile>(GetProfile()));
|
||||
}
|
||||
@ -638,7 +639,7 @@ void ExtensionActionFunction::NotifyLocationBarChange() {
|
||||
|
||||
void ExtensionActionFunction::NotifySystemIndicatorChange() {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
|
||||
content::Source<Profile>(GetProfile()),
|
||||
content::Details<ExtensionAction>(extension_action_));
|
||||
}
|
||||
@ -807,7 +808,7 @@ bool BrowserActionOpenPopupFunction::RunAsync() {
|
||||
}
|
||||
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::Source<Profile>(GetProfile()));
|
||||
|
||||
// Set a timeout for waiting for the notification that the popup is loaded.
|
||||
@ -835,7 +836,7 @@ void BrowserActionOpenPopupFunction::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, type);
|
||||
if (response_sent_)
|
||||
return;
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "base/lazy_instance.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.h"
|
||||
#include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
|
||||
#include "chrome/browser/extensions/api/image_writer_private/operation.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace image_writer_api = extensions::api::image_writer_private;
|
||||
|
||||
@ -34,13 +34,13 @@ OperationManager::OperationManager(content::BrowserContext* context)
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context_);
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
|
||||
content::Source<Profile>(profile));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::Source<Profile>(profile));
|
||||
}
|
||||
|
||||
@ -229,16 +229,16 @@ void OperationManager::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: {
|
||||
DeleteOperation(content::Details<const Extension>(details).ptr()->id());
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
|
||||
DeleteOperation(
|
||||
content::Details<ExtensionHost>(details)->extension()->id());
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
|
||||
DeleteOperation(
|
||||
content::Details<ExtensionHost>(details)->extension()->id());
|
||||
break;
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/management/management_api.h"
|
||||
#include "chrome/browser/extensions/api/management/management_api_constants.h"
|
||||
#include "chrome/browser/extensions/extension_browsertest.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace keys = extension_management_api_constants;
|
||||
namespace util = extension_function_test_utils;
|
||||
@ -297,7 +297,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiEscalationTest,
|
||||
// crash it. (NOTIFICATION_RENDERER_PROCESS_CREATED does not wait for the
|
||||
// latter and can cause KillProcess to fail on Windows.)
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_CREATED,
|
||||
content::NotificationService::AllSources());
|
||||
ExtensionInstallPrompt::g_auto_confirm_for_tests =
|
||||
ExtensionInstallPrompt::ACCEPT;
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "base/prefs/scoped_user_pref_update.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_browsertest.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/extension_test_message_listener.h"
|
||||
@ -28,6 +27,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/pref_names.h"
|
||||
#include "net/url_request/url_fetcher.h"
|
||||
|
||||
@ -174,10 +174,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, DisableEnable) {
|
||||
class NotificationListener : public content::NotificationObserver {
|
||||
public:
|
||||
NotificationListener() : started_(false), finished_(false) {
|
||||
int types[] = {
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND
|
||||
};
|
||||
int types[] = {extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND};
|
||||
for (size_t i = 0; i < arraysize(types); i++) {
|
||||
registrar_.Add(
|
||||
this, types[i], content::NotificationService::AllSources());
|
||||
@ -202,12 +200,12 @@ class NotificationListener : public content::NotificationObserver {
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED: {
|
||||
EXPECT_FALSE(started_);
|
||||
started_ = true;
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND: {
|
||||
const std::string& id =
|
||||
content::Details<extensions::UpdateDetails>(details)->id;
|
||||
updates_.insert(id);
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/chromeos/login/helper.h"
|
||||
#include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
|
||||
#include "chromeos/chromeos_switches.h"
|
||||
@ -39,6 +38,7 @@
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "policy/policy_constants.h"
|
||||
#include "third_party/cros_system_api/dbus/service_constants.h"
|
||||
#else // !defined(OS_CHROMEOS)
|
||||
@ -82,7 +82,7 @@ class TestListener : public content::NotificationObserver {
|
||||
TestListener(const std::string& message, const base::Closure& callback)
|
||||
: message_(message), callback_(callback) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/notifications/notifications_api.h"
|
||||
#include "chrome/browser/extensions/extension_apitest.h"
|
||||
#include "chrome/browser/extensions/extension_function_test_utils.h"
|
||||
@ -15,6 +14,7 @@
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/features/feature.h"
|
||||
#include "ui/message_center/message_center.h"
|
||||
#include "ui/message_center/notification_list.h"
|
||||
@ -32,7 +32,7 @@ class UserGestureCatcher : public content::NotificationObserver {
|
||||
public:
|
||||
UserGestureCatcher() : waiting_(false) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ class NotificationsApiTest : public ExtensionApiTest {
|
||||
const std::string& test_name) {
|
||||
base::FilePath extdir = test_data_dir_.AppendASCII(test_name);
|
||||
content::WindowedNotificationObserver page_created(
|
||||
chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
content::NotificationService::AllSources());
|
||||
const extensions::Extension* extension = LoadExtension(extdir);
|
||||
if (extension) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/tab_helper.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/search_engines/template_url_service_factory.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_prefs_factory.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
namespace extensions {
|
||||
@ -159,7 +159,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
|
||||
->DispatchEventToExtension(extension_id, event.Pass());
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
|
||||
content::Source<Profile>(profile),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
@ -282,7 +282,7 @@ bool OmniboxSendSuggestionsFunction::RunSync() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
|
||||
content::Source<Profile>(GetProfile()->GetOriginalProfile()),
|
||||
content::Details<SendSuggestions::Params>(params.get()));
|
||||
|
||||
@ -297,7 +297,7 @@ bool OmniboxSetDefaultSuggestionFunction::RunSync() {
|
||||
if (SetOmniboxDefaultSuggestion(
|
||||
GetProfile(), extension_id(), params->suggestion)) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
|
||||
extensions::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
|
||||
content::Source<Profile>(GetProfile()->GetOriginalProfile()),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/extension_warning_service.h"
|
||||
#include "chrome/browser/extensions/extension_warning_set.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "components/omaha_query_params/omaha_query_params.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/api/runtime.h"
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@ -53,7 +53,7 @@ ChromeRuntimeAPIDelegate::ChromeRuntimeAPIDelegate(
|
||||
content::BrowserContext* context)
|
||||
: browser_context_(context), registered_for_updates_(false) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ void ChromeRuntimeAPIDelegate::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK(type == chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND);
|
||||
DCHECK(type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND);
|
||||
typedef const std::pair<std::string, Version> UpdateDetails;
|
||||
const std::string& id = content::Details<UpdateDetails>(details)->first;
|
||||
const Version& version = content::Details<UpdateDetails>(details)->second;
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h"
|
||||
#include "chrome/browser/extensions/extension_apitest.h"
|
||||
#include "chrome/browser/signin/signin_manager_factory.h"
|
||||
@ -10,6 +9,7 @@
|
||||
#include "components/signin/core/common/profile_management_switches.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/switches.h"
|
||||
|
||||
namespace extensions {
|
||||
@ -51,7 +51,7 @@ class ScreenlockPrivateApiTest : public ExtensionApiTest,
|
||||
// ExtensionApiTest override:
|
||||
virtual void RunTestOnMainThreadLoop() OVERRIDE {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
ExtensionApiTest::RunTestOnMainThreadLoop();
|
||||
registrar_.RemoveAll();
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "base/memory/linked_ptr.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_action.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
@ -127,7 +127,8 @@ SystemIndicatorManager::SystemIndicatorManager(Profile* profile,
|
||||
extension_registry_observer_(this) {
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(profile_));
|
||||
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
|
||||
content::Source<Profile>(profile_->GetOriginalProfile()));
|
||||
}
|
||||
|
||||
@ -151,7 +152,7 @@ void SystemIndicatorManager::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED);
|
||||
DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED);
|
||||
|
||||
OnSystemIndicatorChanged(content::Details<ExtensionAction>(details).ptr());
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <cctype>
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/crx_installer.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/favicon_downloader.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "extensions/browser/image_loader.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/manifest_handlers/icons_handler.h"
|
||||
@ -174,11 +174,11 @@ BookmarkAppHelper::BookmarkAppHelper(ExtensionService* service,
|
||||
: web_app_info_(web_app_info),
|
||||
crx_installer_(extensions::CrxInstaller::CreateSilent(service)) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<CrxInstaller>(crx_installer_.get()));
|
||||
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::Source<CrxInstaller>(crx_installer_.get()));
|
||||
|
||||
crx_installer_->set_error_on_unsupported_requirements(true);
|
||||
@ -330,7 +330,7 @@ void BookmarkAppHelper::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_CRX_INSTALLER_DONE: {
|
||||
case extensions::NOTIFICATION_CRX_INSTALLER_DONE: {
|
||||
const Extension* extension =
|
||||
content::Details<const Extension>(details).ptr();
|
||||
DCHECK(extension);
|
||||
@ -339,7 +339,7 @@ void BookmarkAppHelper::Observe(int type,
|
||||
callback_.Run(extension, web_app_info_);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR:
|
||||
case extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR:
|
||||
callback_.Run(NULL, web_app_info_);
|
||||
break;
|
||||
default:
|
||||
|
@ -218,7 +218,7 @@ void ChromeAppSorting::FixNTPOrdinalCollisions() {
|
||||
}
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
|
||||
chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
|
||||
content::Source<ChromeAppSorting>(this),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
@ -281,7 +281,7 @@ void ChromeAppSorting::OnExtensionMoved(
|
||||
SyncIfNeeded(moved_extension_id);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
|
||||
chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
|
||||
content::Source<ChromeAppSorting>(this),
|
||||
content::Details<const std::string>(&moved_extension_id));
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/api/permissions/permissions_api.h"
|
||||
#include "chrome/browser/extensions/extension_apitest.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
@ -14,6 +13,7 @@
|
||||
#include "chrome/test/base/ui_test_utils.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "net/dns/mock_host_resolver.h"
|
||||
#include "net/test/embedded_test_server/embedded_test_server.h"
|
||||
@ -209,7 +209,7 @@ IN_PROC_BROWSER_TEST_F(
|
||||
ASSERT_TRUE(StartEmbeddedTestServer());
|
||||
|
||||
content::WindowedNotificationObserver signal(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(browser()->profile()));
|
||||
|
||||
// Start with a renderer already open at a URL.
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_icon_set.h"
|
||||
#include "extensions/common/manifest_handlers/icons_handler.h"
|
||||
@ -44,7 +44,8 @@ class ExtensionFromWebAppTest
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED) {
|
||||
if (type ==
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED) {
|
||||
const Extension* extension =
|
||||
content::Details<const InstalledExtensionInfo>(details)->extension;
|
||||
if (extension->id() == expected_extension_id_) {
|
||||
@ -69,7 +70,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionFromWebAppTest, DISABLED_Basic) {
|
||||
|
||||
content::NotificationRegistrar registrar;
|
||||
registrar.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
expected_extension_id_ = "ffnmbohohhobhkjpfbefbjifapgcmpaa";
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/version.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/convert_user_script.h"
|
||||
#include "chrome/browser/extensions/convert_web_app.h"
|
||||
#include "chrome/browser/extensions/crx_installer_error.h"
|
||||
@ -45,6 +44,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/install_flag.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension_icon_set.h"
|
||||
#include "extensions/common/feature_switch.h"
|
||||
#include "extensions/common/file_util.h"
|
||||
@ -750,7 +750,7 @@ void CrxInstaller::ReportFailureFromUIThread(const CrxInstallerError& error) {
|
||||
|
||||
content::NotificationService* service =
|
||||
content::NotificationService::current();
|
||||
service->Notify(chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
service->Notify(extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::Source<CrxInstaller>(this),
|
||||
content::Details<const base::string16>(&error.message()));
|
||||
|
||||
@ -825,10 +825,9 @@ void CrxInstaller::NotifyCrxInstallComplete(bool success) {
|
||||
// extension before it is unpacked, so they cannot filter based
|
||||
// on the extension.
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<CrxInstaller>(this),
|
||||
content::Details<const Extension>(
|
||||
success ? extension() : NULL));
|
||||
content::Details<const Extension>(success ? extension() : NULL));
|
||||
|
||||
InstallTrackerFactory::GetForBrowserContext(profile())
|
||||
->OnFinishCrxInstall(success ? extension()->id() : expected_id_, success);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/management_policy.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/feature_switch.h"
|
||||
#include "extensions/common/file_util.h"
|
||||
@ -424,7 +425,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest,
|
||||
// Make test extension non-idle by opening the extension's browser action
|
||||
// popup. This should cause the installation to be delayed.
|
||||
content::WindowedNotificationObserver loading_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::Source<Profile>(profile()));
|
||||
BrowserActionTestUtil util(browser());
|
||||
// There is only one extension, so just click the first browser action.
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/extensions/unpacked_installer.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
#include "net/base/escape.h"
|
||||
@ -144,9 +144,11 @@ ExtensionApiTest::~ExtensionApiTest() {}
|
||||
ExtensionApiTest::ResultCatcher::ResultCatcher()
|
||||
: profile_restriction_(NULL),
|
||||
waiting_(false) {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_PASSED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_PASSED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_FAILED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_FAILED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -185,7 +187,7 @@ void ExtensionApiTest::ResultCatcher::Observe(
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_TEST_PASSED:
|
||||
case extensions::NOTIFICATION_EXTENSION_TEST_PASSED:
|
||||
VLOG(1) << "Got EXTENSION_TEST_PASSED notification.";
|
||||
results_.push_back(true);
|
||||
messages_.push_back(std::string());
|
||||
@ -193,7 +195,7 @@ void ExtensionApiTest::ResultCatcher::Observe(
|
||||
base::MessageLoopForUI::current()->Quit();
|
||||
break;
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_TEST_FAILED:
|
||||
case extensions::NOTIFICATION_EXTENSION_TEST_FAILED:
|
||||
VLOG(1) << "Got EXTENSION_TEST_FAILED notification.";
|
||||
results_.push_back(false);
|
||||
messages_.push_back(*(content::Details<std::string>(details).ptr()));
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/browsertest_util.h"
|
||||
#include "chrome/browser/extensions/component_loader.h"
|
||||
#include "chrome/browser/extensions/crx_installer.h"
|
||||
@ -43,6 +42,7 @@
|
||||
#include "extensions/browser/extension_host.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/uninstall_reason.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
@ -151,7 +151,7 @@ ExtensionBrowserTest::LoadExtensionWithInstallParam(
|
||||
ExtensionService* service = extensions::ExtensionSystem::Get(
|
||||
profile())->extension_service();
|
||||
{
|
||||
observer_->Watch(chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
observer_->Watch(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
scoped_refptr<extensions::UnpackedInstaller> installer(
|
||||
@ -197,7 +197,7 @@ ExtensionBrowserTest::LoadExtensionWithInstallParam(
|
||||
// Re-enable the extension if needed.
|
||||
if (service->extensions()->Contains(extension_id)) {
|
||||
content::WindowedNotificationObserver load_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile()));
|
||||
// Reload the extension so that the
|
||||
// NOTIFICATION_EXTENSION_LOADED_DEPRECATED
|
||||
@ -215,7 +215,7 @@ ExtensionBrowserTest::LoadExtensionWithInstallParam(
|
||||
// cases.
|
||||
{
|
||||
content::WindowedNotificationObserver load_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile()));
|
||||
CHECK(!extensions::util::IsIncognitoEnabled(extension_id, profile()));
|
||||
|
||||
@ -229,7 +229,7 @@ ExtensionBrowserTest::LoadExtensionWithInstallParam(
|
||||
|
||||
{
|
||||
content::WindowedNotificationObserver load_signal(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile()));
|
||||
CHECK(extensions::util::AllowFileAccess(extension_id, profile()));
|
||||
if (!(flags & kFlagEnableFileAccess)) {
|
||||
@ -495,7 +495,7 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
|
||||
}
|
||||
|
||||
observer_->Watch(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(installer.get()));
|
||||
|
||||
installer->InstallCrx(crx_path);
|
||||
@ -531,7 +531,7 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
|
||||
}
|
||||
|
||||
void ExtensionBrowserTest::ReloadExtension(const std::string extension_id) {
|
||||
observer_->Watch(chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
observer_->Watch(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
ExtensionService* service =
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "base/metrics/histogram.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/app/chrome_command_ids.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/extension_install_prompt.h"
|
||||
#include "chrome/browser/extensions/extension_install_ui.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
@ -34,6 +33,7 @@
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/extension_util.h"
|
||||
#include "extensions/browser/image_loader.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/browser/uninstall_reason.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
@ -223,9 +223,10 @@ ExtensionDisabledGlobalError::ExtensionDisabledGlobalError(
|
||||
gfx::Size(kIconSize, kIconSize)));
|
||||
}
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(service->profile()));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_REMOVED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_REMOVED,
|
||||
content::Source<Profile>(service->profile()));
|
||||
}
|
||||
|
||||
@ -382,17 +383,17 @@ void ExtensionDisabledGlobalError::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
// The error is invalidated if the extension has been loaded or removed.
|
||||
DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED ||
|
||||
type == chrome::NOTIFICATION_EXTENSION_REMOVED);
|
||||
DCHECK(type == extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED ||
|
||||
type == extensions::NOTIFICATION_EXTENSION_REMOVED);
|
||||
const Extension* extension = content::Details<const Extension>(details).ptr();
|
||||
if (extension != extension_)
|
||||
return;
|
||||
GlobalErrorServiceFactory::GetForProfile(service_->profile())->
|
||||
RemoveGlobalError(this);
|
||||
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED)
|
||||
if (type == extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED)
|
||||
user_response_ = REENABLE;
|
||||
else if (type == chrome::NOTIFICATION_EXTENSION_REMOVED)
|
||||
else if (type == extensions::NOTIFICATION_EXTENSION_REMOVED)
|
||||
user_response_ = UNINSTALL;
|
||||
delete this;
|
||||
}
|
||||
|
@ -13,10 +13,10 @@
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/simple_message_box.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
ExtensionErrorReporter* ExtensionErrorReporter::instance_ = NULL;
|
||||
|
||||
@ -46,7 +46,7 @@ void ExtensionErrorReporter::ReportLoadError(
|
||||
content::BrowserContext* browser_context,
|
||||
bool be_noisy) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LOAD_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_LOAD_ERROR,
|
||||
content::Source<Profile>(Profile::FromBrowserContext(browser_context)),
|
||||
content::Details<const std::string>(&error));
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/crx_installer.h"
|
||||
#include "chrome/browser/extensions/extension_browsertest.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
@ -12,6 +11,7 @@
|
||||
#include "chrome/test/base/ui_test_utils.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
namespace extensions {
|
||||
|
||||
@ -25,7 +25,7 @@ class ExtensionFunctionalTest : public ExtensionBrowserTest {
|
||||
base::FilePath path = test_data_dir_.AppendASCII(filename);
|
||||
|
||||
content::WindowedNotificationObserver extension_loaded_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
scoped_refptr<extensions::CrxInstaller> installer(
|
||||
@ -37,7 +37,7 @@ class ExtensionFunctionalTest : public ExtensionBrowserTest {
|
||||
extensions::CrxInstaller::OffStoreInstallAllowedInTest);
|
||||
|
||||
observer_->Watch(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(installer.get()));
|
||||
|
||||
installer->InstallCrx(path);
|
||||
|
@ -315,7 +315,7 @@ class ExtensionGCMAppHandlerTest : public testing::Test {
|
||||
|
||||
extensions::CrxInstaller* installer = NULL;
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
base::Bind(&IsCrxInstallerDone, &installer));
|
||||
extension_service_->UpdateExtension(
|
||||
extension->id(), path, true, &installer);
|
||||
|
@ -50,7 +50,8 @@ ExtensionInfoBarDelegate::ExtensionInfoBarDelegate(
|
||||
|
||||
extension_registry_observer_.Add(
|
||||
extensions::ExtensionRegistry::Get(browser->profile()));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
|
||||
content::Source<Profile>(browser->profile()));
|
||||
|
||||
height_ = std::max(0, height);
|
||||
@ -109,7 +110,7 @@ void ExtensionInfoBarDelegate::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE);
|
||||
DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE);
|
||||
if (extension_view_host_.get() ==
|
||||
content::Details<extensions::ExtensionHost>(details).ptr())
|
||||
infobar()->RemoveSelf();
|
||||
|
@ -200,7 +200,7 @@ class NewTabUISortingBrowserTest : public ExtensionInstallUIBrowserTest,
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
if (type != chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED) {
|
||||
if (type != chrome::NOTIFICATION_APP_LAUNCHER_REORDERED) {
|
||||
observer_->Observe(type, source, details);
|
||||
return;
|
||||
}
|
||||
@ -233,8 +233,9 @@ IN_PROC_BROWSER_TEST_F(NewTabUISortingBrowserTest,
|
||||
extensions::ExtensionPrefs::Get(browser()->profile())->app_sorting();
|
||||
|
||||
// Register for notifications in the same way as AppLauncherHandler.
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
|
||||
content::Source<AppSorting>(sorting));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
|
||||
content::Source<AppSorting>(sorting));
|
||||
// ExtensionAppItem calls this when an app install starts.
|
||||
sorting->EnsureValidOrdinals(app_id, syncer::StringOrdinal());
|
||||
// Vefify the app is not actually installed yet.
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "chrome/browser/extensions/extension_keybinding_registry.h"
|
||||
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/extensions/active_tab_permission_granter.h"
|
||||
#include "chrome/browser/extensions/extension_service.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -14,6 +13,7 @@
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
#include "extensions/common/manifest_constants.h"
|
||||
|
||||
@ -31,10 +31,10 @@ ExtensionKeybindingRegistry::ExtensionKeybindingRegistry(
|
||||
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context_);
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED,
|
||||
extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED,
|
||||
content::Source<Profile>(profile->GetOriginalProfile()));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED,
|
||||
extensions::NOTIFICATION_EXTENSION_COMMAND_REMOVED,
|
||||
content::Source<Profile>(profile->GetOriginalProfile()));
|
||||
}
|
||||
|
||||
@ -184,8 +184,8 @@ void ExtensionKeybindingRegistry::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED:
|
||||
case chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED:
|
||||
case extensions::NOTIFICATION_EXTENSION_COMMAND_REMOVED: {
|
||||
std::pair<const std::string, const std::string>* payload =
|
||||
content::Details<std::pair<const std::string, const std::string> >(
|
||||
details).ptr();
|
||||
@ -200,7 +200,7 @@ void ExtensionKeybindingRegistry::Observe(
|
||||
return;
|
||||
|
||||
if (ExtensionMatchesFilter(extension)) {
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED)
|
||||
if (type == extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED)
|
||||
AddExtensionKeybinding(extension, payload->second);
|
||||
else
|
||||
RemoveExtensionKeybinding(extension, payload->second);
|
||||
|
@ -46,7 +46,8 @@ namespace {
|
||||
class MessageSender : public content::NotificationObserver {
|
||||
public:
|
||||
MessageSender() {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,13 @@ namespace extensions {
|
||||
|
||||
namespace {
|
||||
|
||||
std::string Str(const std::vector<chrome::NotificationType>& types) {
|
||||
std::string Str(const std::vector<extensions::NotificationType>& types) {
|
||||
std::string str = "[";
|
||||
bool needs_comma = false;
|
||||
for (std::vector<chrome::NotificationType>::const_iterator it =
|
||||
types.begin(); it != types.end(); ++it) {
|
||||
for (std::vector<extensions::NotificationType>::const_iterator it =
|
||||
types.begin();
|
||||
it != types.end();
|
||||
++it) {
|
||||
if (needs_comma)
|
||||
str += ",";
|
||||
needs_comma = true;
|
||||
@ -35,39 +37,40 @@ ExtensionNotificationObserver::ExtensionNotificationObserver(
|
||||
const std::set<std::string>& extension_ids)
|
||||
: extension_ids_(extension_ids) {
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, source);
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
source);
|
||||
this, extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, source);
|
||||
registrar_.Add(
|
||||
this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, source);
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
source);
|
||||
registrar_.Add(
|
||||
this, extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, source);
|
||||
}
|
||||
|
||||
ExtensionNotificationObserver::~ExtensionNotificationObserver() {}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications() {
|
||||
return CheckNotifications(std::vector<chrome::NotificationType>());
|
||||
return CheckNotifications(std::vector<extensions::NotificationType>());
|
||||
}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
chrome::NotificationType type) {
|
||||
return CheckNotifications(std::vector<chrome::NotificationType>(1, type));
|
||||
extensions::NotificationType type) {
|
||||
return CheckNotifications(std::vector<extensions::NotificationType>(1, type));
|
||||
}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2) {
|
||||
std::vector<chrome::NotificationType> types;
|
||||
extensions::NotificationType t1,
|
||||
extensions::NotificationType t2) {
|
||||
std::vector<extensions::NotificationType> types;
|
||||
types.push_back(t1);
|
||||
types.push_back(t2);
|
||||
return CheckNotifications(types);
|
||||
}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2,
|
||||
chrome::NotificationType t3) {
|
||||
std::vector<chrome::NotificationType> types;
|
||||
extensions::NotificationType t1,
|
||||
extensions::NotificationType t2,
|
||||
extensions::NotificationType t3) {
|
||||
std::vector<extensions::NotificationType> types;
|
||||
types.push_back(t1);
|
||||
types.push_back(t2);
|
||||
types.push_back(t3);
|
||||
@ -75,13 +78,13 @@ testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2,
|
||||
chrome::NotificationType t3,
|
||||
chrome::NotificationType t4,
|
||||
chrome::NotificationType t5,
|
||||
chrome::NotificationType t6) {
|
||||
std::vector<chrome::NotificationType> types;
|
||||
extensions::NotificationType t1,
|
||||
extensions::NotificationType t2,
|
||||
extensions::NotificationType t3,
|
||||
extensions::NotificationType t4,
|
||||
extensions::NotificationType t5,
|
||||
extensions::NotificationType t6) {
|
||||
std::vector<extensions::NotificationType> types;
|
||||
types.push_back(t1);
|
||||
types.push_back(t2);
|
||||
types.push_back(t3);
|
||||
@ -97,27 +100,30 @@ void ExtensionNotificationObserver::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
const Extension* extension =
|
||||
content::Details<const InstalledExtensionInfo>(details)->extension;
|
||||
if (extension_ids_.count(extension->id()))
|
||||
notifications_.push_back(static_cast<chrome::NotificationType>(type));
|
||||
notifications_.push_back(
|
||||
static_cast<extensions::NotificationType>(type));
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
const Extension* extension =
|
||||
content::Details<const Extension>(details).ptr();
|
||||
if (extension_ids_.count(extension->id()))
|
||||
notifications_.push_back(static_cast<chrome::NotificationType>(type));
|
||||
notifications_.push_back(
|
||||
static_cast<extensions::NotificationType>(type));
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
UnloadedExtensionInfo* reason =
|
||||
content::Details<UnloadedExtensionInfo>(details).ptr();
|
||||
if (extension_ids_.count(reason->extension->id())) {
|
||||
notifications_.push_back(static_cast<chrome::NotificationType>(type));
|
||||
notifications_.push_back(
|
||||
static_cast<extensions::NotificationType>(type));
|
||||
// The only way that extensions are unloaded in these tests is
|
||||
// by blacklisting.
|
||||
EXPECT_EQ(UnloadedExtensionInfo::REASON_BLACKLIST,
|
||||
@ -133,7 +139,7 @@ void ExtensionNotificationObserver::Observe(
|
||||
}
|
||||
|
||||
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
|
||||
const std::vector<chrome::NotificationType>& types) {
|
||||
const std::vector<extensions::NotificationType>& types) {
|
||||
testing::AssertionResult result = (notifications_ == types) ?
|
||||
testing::AssertionSuccess() :
|
||||
testing::AssertionFailure() << "Expected " << Str(types) << ", " <<
|
||||
|
@ -9,12 +9,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "content/public/browser/notification_details.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace extensions {
|
||||
@ -32,22 +32,22 @@ class ExtensionNotificationObserver : public content::NotificationObserver {
|
||||
// notifications occurred for any extensions in |extension_ids|, and no more,
|
||||
// since the last time any of these methods were called.
|
||||
testing::AssertionResult CheckNotifications() WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(
|
||||
chrome::NotificationType type) WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2) WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2,
|
||||
chrome::NotificationType t3) WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(
|
||||
chrome::NotificationType t1,
|
||||
chrome::NotificationType t2,
|
||||
chrome::NotificationType t3,
|
||||
chrome::NotificationType t4,
|
||||
chrome::NotificationType t5,
|
||||
chrome::NotificationType t6) WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(extensions::NotificationType type)
|
||||
WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(extensions::NotificationType t1,
|
||||
extensions::NotificationType t2)
|
||||
WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(extensions::NotificationType t1,
|
||||
extensions::NotificationType t2,
|
||||
extensions::NotificationType t3)
|
||||
WARN_UNUSED_RESULT;
|
||||
testing::AssertionResult CheckNotifications(extensions::NotificationType t1,
|
||||
extensions::NotificationType t2,
|
||||
extensions::NotificationType t3,
|
||||
extensions::NotificationType t4,
|
||||
extensions::NotificationType t5,
|
||||
extensions::NotificationType t6)
|
||||
WARN_UNUSED_RESULT;
|
||||
|
||||
private:
|
||||
// content::NotificationObserver implementation.
|
||||
@ -57,10 +57,10 @@ class ExtensionNotificationObserver : public content::NotificationObserver {
|
||||
|
||||
// Checks then clears notifications for our extensions.
|
||||
testing::AssertionResult CheckNotifications(
|
||||
const std::vector<chrome::NotificationType>& types);
|
||||
const std::vector<extensions::NotificationType>& types);
|
||||
|
||||
const std::set<std::string> extension_ids_;
|
||||
std::vector<chrome::NotificationType> notifications_;
|
||||
std::vector<extensions::NotificationType> notifications_;
|
||||
content::NotificationRegistrar registrar_;
|
||||
};
|
||||
|
||||
|
@ -269,7 +269,8 @@ ExtensionService::ExtensionService(Profile* profile,
|
||||
|
||||
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
@ -707,7 +708,7 @@ bool ExtensionService::UninstallExtension(
|
||||
!system_->management_policy()->UserMayModifySettings(
|
||||
extension.get(), error)) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension.get()));
|
||||
return false;
|
||||
@ -749,7 +750,7 @@ bool ExtensionService::UninstallExtension(
|
||||
|
||||
// Notify interested parties that we've uninstalled this extension.
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension.get()));
|
||||
ExtensionRegistry::Get(profile_)
|
||||
@ -831,7 +832,7 @@ void ExtensionService::EnableExtension(const std::string& extension_id) {
|
||||
|
||||
// Notify listeners that the extension was enabled.
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_ENABLED,
|
||||
extensions::NOTIFICATION_EXTENSION_ENABLED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension));
|
||||
|
||||
@ -997,7 +998,7 @@ void ExtensionService::NotifyExtensionLoaded(const Extension* extension) {
|
||||
registry_->TriggerOnLoaded(extension);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension));
|
||||
|
||||
@ -1047,7 +1048,7 @@ void ExtensionService::NotifyExtensionUnloaded(
|
||||
registry_->TriggerOnUnloaded(extension, reason);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<UnloadedExtensionInfo>(&details));
|
||||
|
||||
@ -1280,7 +1281,7 @@ void ExtensionService::UnloadExtension(
|
||||
}
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_REMOVED,
|
||||
extensions::NOTIFICATION_EXTENSION_REMOVED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension.get()));
|
||||
}
|
||||
@ -1292,7 +1293,7 @@ void ExtensionService::RemoveComponentExtension(
|
||||
UnloadExtension(extension_id, UnloadedExtensionInfo::REASON_UNINSTALL);
|
||||
if (extension.get()) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension.get()));
|
||||
ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(
|
||||
@ -1317,7 +1318,7 @@ void ExtensionService::ReloadExtensionsForTest() {
|
||||
void ExtensionService::SetReadyAndNotifyListeners() {
|
||||
ready_->Signal();
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
@ -1388,7 +1389,7 @@ void ExtensionService::AddExtension(const Extension* extension) {
|
||||
if (extension_sync_service_)
|
||||
extension_sync_service_->SyncExtensionChangeIfNeeded(*extension);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension));
|
||||
|
||||
@ -1792,7 +1793,7 @@ void ExtensionService::FinishInstallation(
|
||||
extensions::InstalledExtensionInfo details(
|
||||
extension, is_update, from_ephemeral, old_name);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const extensions::InstalledExtensionInfo>(&details));
|
||||
|
||||
@ -1854,7 +1855,7 @@ void ExtensionService::PromoteEphemeralApp(
|
||||
true /* from ephemeral */,
|
||||
extension->name() /* old name */);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const extensions::InstalledExtensionInfo>(&details));
|
||||
|
||||
@ -1866,7 +1867,7 @@ void ExtensionService::PromoteEphemeralApp(
|
||||
|
||||
if (registry_->enabled_extensions().Contains(extension->id())) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension));
|
||||
|
||||
@ -1903,7 +1904,7 @@ void ExtensionService::UntrackTerminatedExtension(const std::string& id) {
|
||||
registry_->RemoveTerminated(lowercase_id);
|
||||
if (extension) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_REMOVED,
|
||||
extensions::NOTIFICATION_EXTENSION_REMOVED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<const Extension>(extension));
|
||||
}
|
||||
@ -2012,7 +2013,7 @@ void ExtensionService::Observe(int type,
|
||||
// happens too late in browser teardown.)
|
||||
browser_terminating_ = true;
|
||||
break;
|
||||
case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: {
|
||||
if (profile_ !=
|
||||
content::Source<Profile>(source).ptr()->GetOriginalProfile()) {
|
||||
break;
|
||||
|
@ -470,20 +470,22 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
false),
|
||||
expected_extensions_count_(0) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
const Extension* extension =
|
||||
content::Details<const Extension>(details).ptr();
|
||||
loaded_.push_back(make_scoped_refptr(extension));
|
||||
@ -493,7 +495,7 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
UnloadedExtensionInfo* unloaded_info =
|
||||
content::Details<UnloadedExtensionInfo>(details).ptr();
|
||||
const Extension* e = unloaded_info->extension;
|
||||
@ -508,7 +510,7 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
loaded_.erase(i);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
const extensions::InstalledExtensionInfo* installed_info =
|
||||
content::Details<const extensions::InstalledExtensionInfo>(details)
|
||||
.ptr();
|
||||
@ -665,7 +667,7 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
installer->set_install_source(install_location);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
installer->InstallCrx(crx_path);
|
||||
observer.Wait();
|
||||
@ -791,7 +793,7 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
|
||||
extensions::CrxInstaller* installer = NULL;
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
base::Bind(&IsCrxInstallerDone, &installer));
|
||||
service()->UpdateExtension(id, path, true, &installer);
|
||||
|
||||
@ -1105,7 +1107,7 @@ class ExtensionServiceTest : public extensions::ExtensionServiceTestBase,
|
||||
installer->set_allow_silent_install(true);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(installer));
|
||||
|
||||
installer->InstallCrx(crx_path);
|
||||
@ -1487,7 +1489,7 @@ TEST_F(ExtensionServiceTest, InstallingExternalExtensionWithFlags) {
|
||||
// Register and install an external extension.
|
||||
Version version("1.0.0.0");
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
if (service()->OnExternalExtensionFileFound(good_crx,
|
||||
&version,
|
||||
@ -1522,7 +1524,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) {
|
||||
// Install an external extension.
|
||||
Version version("1.0.0.0");
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
if (service()->OnExternalExtensionFileFound(good_crx,
|
||||
&version,
|
||||
@ -1620,7 +1622,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongId) {
|
||||
// Install an external extension with an ID from the external
|
||||
// source that is not equal to the ID in the extension manifest.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->OnExternalExtensionFileFound(wrong_id,
|
||||
&version,
|
||||
@ -1634,7 +1636,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongId) {
|
||||
|
||||
// Try again with the right ID. Expect success.
|
||||
content::WindowedNotificationObserver observer2(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
if (service()->OnExternalExtensionFileFound(correct_id,
|
||||
&version,
|
||||
@ -1657,7 +1659,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) {
|
||||
// source that is not equal to the version in the extension manifest.
|
||||
Version wrong_version("1.2.3.4");
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->OnExternalExtensionFileFound(good_crx,
|
||||
&wrong_version,
|
||||
@ -1673,7 +1675,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) {
|
||||
service()->pending_extension_manager()->Remove(good_crx);
|
||||
Version correct_version("1.0.0.0");
|
||||
content::WindowedNotificationObserver observer2(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
if (service()->OnExternalExtensionFileFound(good_crx,
|
||||
&correct_version,
|
||||
@ -3682,7 +3684,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) {
|
||||
// Reloading extensions should find our externally registered extension
|
||||
// and install it.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -3878,7 +3880,7 @@ TEST_F(ExtensionServiceTest, MAYBE_ExternalExtensionAutoAcknowledgement) {
|
||||
// Providers are set up. Let them run.
|
||||
int count = 2;
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
base::Bind(&WaitForCountNotificationsCallback, &count));
|
||||
service()->CheckForExternalUpdates();
|
||||
|
||||
@ -3920,7 +3922,7 @@ TEST_F(ExtensionServiceTest, DefaultAppsInstall) {
|
||||
|
||||
ASSERT_EQ(0u, registry()->enabled_extensions().size());
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -4608,7 +4610,7 @@ void ExtensionServiceTest::TestExternalProvider(
|
||||
// Reloading extensions should find our externally registered extension
|
||||
// and install it.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -4638,7 +4640,7 @@ void ExtensionServiceTest::TestExternalProvider(
|
||||
|
||||
loaded_.clear();
|
||||
content::WindowedNotificationObserver observer_2(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer_2.Wait();
|
||||
@ -4681,7 +4683,7 @@ void ExtensionServiceTest::TestExternalProvider(
|
||||
|
||||
loaded_.clear();
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -4710,7 +4712,7 @@ void ExtensionServiceTest::TestExternalProvider(
|
||||
// Now test the case where user uninstalls and then the extension is removed
|
||||
// from the external provider.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
provider->UpdateOrAddExtension(good_crx, "1.0.0.1", source_path);
|
||||
service()->CheckForExternalUpdates();
|
||||
@ -4863,7 +4865,7 @@ TEST_F(ExtensionServiceTest, MultipleExternalUpdateCheck) {
|
||||
// Two checks for external updates should find the extension, and install it
|
||||
// once.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
provider->set_visit_count(0);
|
||||
service()->CheckForExternalUpdates();
|
||||
@ -5111,7 +5113,8 @@ TEST_F(ExtensionServiceTest, LoadAndRelocalizeExtensions) {
|
||||
class ExtensionsReadyRecorder : public content::NotificationObserver {
|
||||
public:
|
||||
ExtensionsReadyRecorder() : ready_(false) {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -5123,7 +5126,7 @@ class ExtensionsReadyRecorder : public content::NotificationObserver {
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSIONS_READY:
|
||||
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED:
|
||||
ready_ = true;
|
||||
break;
|
||||
default:
|
||||
@ -6253,7 +6256,7 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) {
|
||||
{
|
||||
// Simulate an external source adding the extension as INTERNAL.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
EXPECT_TRUE(service()->OnExternalExtensionFileFound(kGoodId,
|
||||
&older_version,
|
||||
@ -6269,7 +6272,7 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) {
|
||||
{
|
||||
// Simulate an external source adding the extension as EXTERNAL_PREF.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
EXPECT_TRUE(service()->OnExternalExtensionFileFound(kGoodId,
|
||||
&older_version,
|
||||
@ -6305,7 +6308,7 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) {
|
||||
{
|
||||
// Now the registry adds the extension.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
EXPECT_TRUE(
|
||||
service()->OnExternalExtensionFileFound(kGoodId,
|
||||
@ -6622,7 +6625,7 @@ TEST_F(ExtensionSourcePriorityTest, PendingExternalFileOverSync) {
|
||||
|
||||
// Install pending extension from sync.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
EXPECT_TRUE(AddPendingSyncInstall());
|
||||
ASSERT_EQ(Manifest::INTERNAL, GetPendingLocation());
|
||||
@ -6681,7 +6684,7 @@ TEST_F(ExtensionSourcePriorityTest, InstallExternalBlocksSyncRequest) {
|
||||
// Before the CRX installer runs, Sync requests that the same extension
|
||||
// be installed. Should fail, because an external source is pending.
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
ASSERT_FALSE(AddPendingSyncInstall());
|
||||
|
||||
@ -6728,7 +6731,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) {
|
||||
hosted_app, "1.0.0.0", data_dir().AppendASCII("hosted_app.crx"));
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6741,7 +6744,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) {
|
||||
page_action, "1.0.0.0", data_dir().AppendASCII("page_action.crx"));
|
||||
|
||||
content::WindowedNotificationObserver observer2(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer2.Wait();
|
||||
@ -6763,7 +6766,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallInitiallyDisabled) {
|
||||
page_action, "1.0.0.0", data_dir().AppendASCII("page_action.crx"));
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6806,7 +6809,7 @@ TEST_F(ExtensionServiceTest, MAYBE_ExternalInstallMultiple) {
|
||||
|
||||
int count = 3;
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
base::Bind(&WaitForCountNotificationsCallback, &count));
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6858,7 +6861,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallUpdatesFromWebstoreOldProfile) {
|
||||
provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6887,7 +6890,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallUpdatesFromWebstoreNewProfile) {
|
||||
provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service()->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6919,7 +6922,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallClickToRemove) {
|
||||
provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service_->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -6961,7 +6964,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallClickToKeep) {
|
||||
provider->UpdateOrAddExtension(updates_from_webstore, "1", crx_path);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
service_->CheckForExternalUpdates();
|
||||
observer.Wait();
|
||||
@ -7012,7 +7015,7 @@ TEST_F(ExtensionServiceTest, InstallBlacklistedExtension) {
|
||||
|
||||
// Extension was installed but not loaded.
|
||||
EXPECT_TRUE(notifications.CheckNotifications(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED));
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED));
|
||||
EXPECT_TRUE(service()->GetInstalledExtension(id));
|
||||
|
||||
EXPECT_FALSE(registry()->enabled_extensions().Contains(id));
|
||||
|
@ -129,7 +129,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest {
|
||||
ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled());
|
||||
|
||||
content::WindowedNotificationObserver user_scripts_observer(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::NotificationService::AllSources());
|
||||
extensions::UserScriptMaster* master =
|
||||
extensions::ExtensionSystem::Get(browser()->profile())->
|
||||
@ -221,7 +221,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) {
|
||||
|
||||
for (size_t i = 0; i < extension_list.size(); ++i) {
|
||||
content::WindowedNotificationObserver user_scripts_observer(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::NotificationService::AllSources());
|
||||
extensions::util::SetAllowFileAccess(
|
||||
extension_list[i]->id(), browser()->profile(), false);
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_source.h"
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "extensions/browser/api/test/test_api.h"
|
||||
#include "extensions/browser/notification_types.h"
|
||||
|
||||
ExtensionTestMessageListener::ExtensionTestMessageListener(
|
||||
const std::string& expected_message,
|
||||
@ -22,7 +22,8 @@ ExtensionTestMessageListener::ExtensionTestMessageListener(
|
||||
will_reply_(will_reply),
|
||||
replied_(false),
|
||||
failed_(false) {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -34,7 +35,7 @@ ExtensionTestMessageListener::ExtensionTestMessageListener(bool will_reply)
|
||||
replied_(false),
|
||||
failed_(false) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
@ -81,7 +82,7 @@ void ExtensionTestMessageListener::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, type);
|
||||
|
||||
// Return immediately if we're already satisfied or it's not the right
|
||||
// extension.
|
||||
|
@ -156,7 +156,7 @@ bool ExtensionTestNotificationObserver::WaitForPageActionCountChangeTo(
|
||||
WaitForCondition(
|
||||
base::Bind(
|
||||
&HasExtensionPageActionCountReachedTarget, location_bar, count),
|
||||
chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED);
|
||||
extensions::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ bool ExtensionTestNotificationObserver::WaitForPageActionVisibilityChangeTo(
|
||||
WaitForCondition(
|
||||
base::Bind(
|
||||
&HasExtensionPageActionVisibilityReachedTarget, location_bar, count),
|
||||
chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED);
|
||||
extensions::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -186,20 +186,20 @@ bool ExtensionTestNotificationObserver::WaitForExtensionViewsToLoad() {
|
||||
bool ExtensionTestNotificationObserver::WaitForExtensionInstall() {
|
||||
int before = extension_installs_observed_;
|
||||
WaitForNotification(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED);
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED);
|
||||
return extension_installs_observed_ == (before + 1);
|
||||
}
|
||||
|
||||
bool ExtensionTestNotificationObserver::WaitForExtensionInstallError() {
|
||||
int before = extension_installs_observed_;
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
return extension_installs_observed_ == before;
|
||||
}
|
||||
|
||||
void ExtensionTestNotificationObserver::WaitForExtensionLoad() {
|
||||
WaitForNotification(chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED);
|
||||
WaitForNotification(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED);
|
||||
}
|
||||
|
||||
void ExtensionTestNotificationObserver::WaitForExtensionAndViewLoad() {
|
||||
@ -209,7 +209,7 @@ void ExtensionTestNotificationObserver::WaitForExtensionAndViewLoad() {
|
||||
|
||||
bool ExtensionTestNotificationObserver::WaitForExtensionLoadError() {
|
||||
int before = extension_load_errors_observed_;
|
||||
WaitForNotification(chrome::NOTIFICATION_EXTENSION_LOAD_ERROR);
|
||||
WaitForNotification(extensions::NOTIFICATION_EXTENSION_LOAD_ERROR);
|
||||
return extension_load_errors_observed_ != before;
|
||||
}
|
||||
|
||||
@ -223,14 +223,14 @@ bool ExtensionTestNotificationObserver::WaitForExtensionCrash(
|
||||
return true;
|
||||
}
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
return (service->GetExtensionById(extension_id, true) == NULL);
|
||||
}
|
||||
|
||||
bool ExtensionTestNotificationObserver::WaitForCrxInstallerDone() {
|
||||
int before = crx_installers_done_observed_;
|
||||
WaitForNotification(chrome::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
WaitForNotification(extensions::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
return crx_installers_done_observed_ == (before + 1);
|
||||
}
|
||||
|
||||
@ -254,13 +254,13 @@ void ExtensionTestNotificationObserver::Observe(
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
||||
last_loaded_extension_id_ =
|
||||
content::Details<const Extension>(details).ptr()->id();
|
||||
VLOG(1) << "Got EXTENSION_LOADED notification.";
|
||||
break;
|
||||
|
||||
case chrome::NOTIFICATION_CRX_INSTALLER_DONE:
|
||||
case extensions::NOTIFICATION_CRX_INSTALLER_DONE:
|
||||
VLOG(1) << "Got CRX_INSTALLER_DONE notification.";
|
||||
{
|
||||
const Extension* extension =
|
||||
@ -273,12 +273,12 @@ void ExtensionTestNotificationObserver::Observe(
|
||||
++crx_installers_done_observed_;
|
||||
break;
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED:
|
||||
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED:
|
||||
VLOG(1) << "Got EXTENSION_INSTALLED notification.";
|
||||
++extension_installs_observed_;
|
||||
break;
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR:
|
||||
case extensions::NOTIFICATION_EXTENSION_LOAD_ERROR:
|
||||
VLOG(1) << "Got EXTENSION_LOAD_ERROR notification.";
|
||||
++extension_load_errors_observed_;
|
||||
break;
|
||||
|
@ -210,8 +210,9 @@ void ExtensionToolbarModel::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
type);
|
||||
DCHECK_EQ(
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
type);
|
||||
const Extension* extension =
|
||||
ExtensionRegistry::Get(profile_)->GetExtensionById(
|
||||
*content::Details<const std::string>(details).ptr(),
|
||||
@ -232,7 +233,7 @@ void ExtensionToolbarModel::OnReady() {
|
||||
extension_registry_observer_.Add(registry);
|
||||
registrar_.Add(
|
||||
this,
|
||||
chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
||||
content::Source<ExtensionPrefs>(extension_prefs_));
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ void ExtensionViewHost::LoadInitialURL() {
|
||||
runtime_data()->IsBackgroundPageReady(extension())) {
|
||||
// Make sure the background page loads before any others.
|
||||
registrar()->Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
content::Source<Extension>(extension()));
|
||||
return;
|
||||
}
|
||||
@ -305,7 +305,7 @@ WebContents* ExtensionViewHost::GetVisibleWebContents() const {
|
||||
void ExtensionViewHost::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY) {
|
||||
if (type == extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY) {
|
||||
DCHECK(ExtensionSystem::Get(browser_context())->
|
||||
runtime_data()->IsBackgroundPageReady(extension()));
|
||||
LoadInitialURL();
|
||||
|
@ -68,7 +68,7 @@ ExternalInstallManager::ExternalInstallManager(
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
|
||||
registrar_.Add(
|
||||
this,
|
||||
chrome::NOTIFICATION_EXTENSION_REMOVED,
|
||||
extensions::NOTIFICATION_EXTENSION_REMOVED,
|
||||
content::Source<Profile>(Profile::FromBrowserContext(browser_context_)));
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ void ExternalInstallManager::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_REMOVED, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_REMOVED, type);
|
||||
// The error is invalidated if the extension has been loaded or removed.
|
||||
// It's a shame we have to use the notification system (instead of the
|
||||
// registry observer) for this, but the ExtensionUnloaded notification is
|
||||
|
@ -99,7 +99,7 @@ TEST_F(ExternalProviderImplChromeOSTest, Normal) {
|
||||
|
||||
service_->CheckForExternalUpdates();
|
||||
content::WindowedNotificationObserver(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources()).Wait();
|
||||
|
||||
EXPECT_TRUE(service_->GetInstalledExtension(kExternalAppId));
|
||||
|
@ -85,8 +85,8 @@ class GtalkExtensionTest : public ExtensionBrowserTest {
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(GtalkExtensionTest, InstallCurrent) {
|
||||
content::WindowedNotificationObserver panel_loaded(
|
||||
chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
|
||||
content::NotificationService::AllSources());
|
||||
extensions::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
|
||||
content::NotificationService::AllSources());
|
||||
InstallGtalkExtension(ReadCurrentVersion());
|
||||
panel_loaded.Wait();
|
||||
ASSERT_TRUE(GetViewer());
|
||||
|
@ -18,7 +18,7 @@ InstallTracker::InstallTracker(content::BrowserContext* browser_context,
|
||||
extensions::ExtensionPrefs* prefs)
|
||||
: extension_registry_observer_(this) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
|
||||
content::Source<content::BrowserContext>(browser_context));
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST,
|
||||
@ -29,7 +29,7 @@ InstallTracker::InstallTracker(content::BrowserContext* browser_context,
|
||||
if (prefs) {
|
||||
AppSorting* sorting = prefs->app_sorting();
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
|
||||
chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
|
||||
content::Source<AppSorting>(sorting));
|
||||
pref_change_registrar_.Init(prefs->pref_service());
|
||||
pref_change_registrar_.Add(
|
||||
@ -135,14 +135,14 @@ void InstallTracker::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UPDATE_DISABLED: {
|
||||
const Extension* extension =
|
||||
content::Details<const Extension>(details).ptr();
|
||||
FOR_EACH_OBSERVER(
|
||||
InstallObserver, observers_, OnDisabledExtensionUpdated(extension));
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED: {
|
||||
case chrome::NOTIFICATION_APP_LAUNCHER_REORDERED: {
|
||||
FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered());
|
||||
break;
|
||||
}
|
||||
|
@ -173,8 +173,8 @@ IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, BroadcastEvent) {
|
||||
// Open a tab to a URL that will trigger the page action to show.
|
||||
LazyBackgroundObserver page_complete;
|
||||
content::WindowedNotificationObserver page_action_changed(
|
||||
chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
|
||||
content::NotificationService::AllSources());
|
||||
extensions::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
|
||||
content::NotificationService::AllSources());
|
||||
ui_test_utils::NavigateToURL(
|
||||
browser(), embedded_test_server()->GetURL("/extensions/test_file.html"));
|
||||
page_complete.Wait();
|
||||
|
@ -13,17 +13,15 @@
|
||||
class LazyBackgroundObserver {
|
||||
public:
|
||||
LazyBackgroundObserver()
|
||||
: page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
: page_created_(extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
content::NotificationService::AllSources()),
|
||||
page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources()) {
|
||||
}
|
||||
page_closed_(extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::NotificationService::AllSources()) {}
|
||||
explicit LazyBackgroundObserver(Profile* profile)
|
||||
: page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
: page_created_(extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
|
||||
content::NotificationService::AllSources()),
|
||||
page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::Source<Profile>(profile)) {
|
||||
}
|
||||
page_closed_(extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
|
||||
content::Source<Profile>(profile)) {}
|
||||
void Wait() {
|
||||
page_created_.Wait();
|
||||
page_closed_.Wait();
|
||||
|
@ -302,7 +302,7 @@ void PermissionsUpdater::NotifyPermissionsUpdated(
|
||||
extension, changed, reason);
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context_);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
content::Source<Profile>(profile),
|
||||
content::Details<UpdatedExtensionPermissionsInfo>(&info));
|
||||
|
||||
|
@ -101,7 +101,7 @@ class PermissionsUpdaterListener : public content::NotificationObserver {
|
||||
PermissionsUpdaterListener()
|
||||
: received_notification_(false), waiting_(false) {
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ void TabHelper::DidNavigateMainFrame(
|
||||
if (browser_action) {
|
||||
browser_action->ClearAllValuesForTab(SessionID::IdForTab(web_contents()));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
|
||||
content::Source<ExtensionAction>(browser_action),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ ExtensionCacheImpl::ExtensionCacheImpl()
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))) {
|
||||
notification_registrar_.Add(
|
||||
this,
|
||||
chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
cache_->Init(true, base::Bind(&ExtensionCacheImpl::OnCacheInitialized,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
@ -123,7 +123,7 @@ void ExtensionCacheImpl::Observe(int type,
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
case extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
extensions::CrxInstaller* installer =
|
||||
content::Source<extensions::CrxInstaller>(source).ptr();
|
||||
// TODO(dpolukhin): remove extension from cache only if installation
|
||||
|
@ -825,7 +825,7 @@ void ExtensionDownloader::NotifyUpdateFound(const std::string& id,
|
||||
const std::string& version) {
|
||||
UpdateDetails updateInfo(id, Version(version));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
content::NotificationService::AllBrowserContextsAndSources(),
|
||||
content::Details<UpdateDetails>(&updateInfo));
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ void ExtensionUpdater::MaybeInstallCRXFile() {
|
||||
// Source parameter ensures that we only see the completion event for the
|
||||
// the installer we started.
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<CrxInstaller>(installer));
|
||||
} else {
|
||||
for (std::set<int>::const_iterator it = crx_file.request_ids.begin();
|
||||
@ -596,11 +596,9 @@ void ExtensionUpdater::MaybeInstallCRXFile() {
|
||||
void ExtensionUpdater::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(type, chrome::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
DCHECK_EQ(type, extensions::NOTIFICATION_CRX_INSTALLER_DONE);
|
||||
|
||||
registrar_.Remove(this,
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
source);
|
||||
registrar_.Remove(this, extensions::NOTIFICATION_CRX_INSTALLER_DONE, source);
|
||||
crx_install_is_running_ = false;
|
||||
|
||||
const FetchedCRXFile& crx_file = current_crx_file_;
|
||||
@ -626,7 +624,7 @@ void ExtensionUpdater::OnExtensionWillBeInstalled(
|
||||
|
||||
void ExtensionUpdater::NotifyStarted() {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::NotificationService::NoDetails());
|
||||
}
|
||||
|
@ -185,8 +185,8 @@ class MockExtensionDownloaderDelegate : public ExtensionDownloaderDelegate {
|
||||
};
|
||||
|
||||
const int kNotificationsObserved[] = {
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND,
|
||||
};
|
||||
|
||||
// A class that observes the notifications sent by the ExtensionUpdater and
|
||||
@ -234,7 +234,7 @@ class NotificationsObserver : public content::NotificationObserver {
|
||||
for (size_t i = 0; i < arraysize(kNotificationsObserved); ++i) {
|
||||
if (kNotificationsObserved[i] == type) {
|
||||
count_[i]++;
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND) {
|
||||
if (type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND) {
|
||||
updated_.insert(
|
||||
content::Details<UpdateDetails>(details)->id);
|
||||
}
|
||||
|
@ -72,11 +72,13 @@ UserScriptListener::UserScriptListener()
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
@ -208,7 +210,7 @@ void UserScriptListener::Observe(int type,
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
const Extension* extension =
|
||||
content::Details<const Extension>(details).ptr();
|
||||
@ -225,7 +227,7 @@ void UserScriptListener::Observe(int type,
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
const Extension* unloaded_extension =
|
||||
content::Details<UnloadedExtensionInfo>(details)->extension;
|
||||
@ -247,7 +249,7 @@ void UserScriptListener::Observe(int type,
|
||||
break;
|
||||
}
|
||||
|
||||
case chrome::NOTIFICATION_USER_SCRIPTS_UPDATED: {
|
||||
case extensions::NOTIFICATION_USER_SCRIPTS_UPDATED: {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
|
||||
&UserScriptListener::UserScriptsReady, this, profile));
|
||||
|
@ -217,7 +217,7 @@ TEST_F(UserScriptListenerTest, DelayAndUpdate) {
|
||||
ASSERT_FALSE(request->is_pending());
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(profile_.get()),
|
||||
content::NotificationService::NoDetails());
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
@ -242,7 +242,7 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) {
|
||||
ASSERT_FALSE(request->is_pending());
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(profile_.get()),
|
||||
content::NotificationService::NoDetails());
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
@ -294,7 +294,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) {
|
||||
extensions::ExtensionRegistry::Get(&profile2)->AddEnabled(extension);
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(&profile2),
|
||||
content::Details<Extension>(extension.get()));
|
||||
|
||||
@ -307,7 +307,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) {
|
||||
// When the first profile's user scripts are ready, the request should still
|
||||
// be blocked waiting for profile2.
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(profile_.get()),
|
||||
content::NotificationService::NoDetails());
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
@ -316,7 +316,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) {
|
||||
|
||||
// After profile2 is ready, the request should proceed.
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(&profile2),
|
||||
content::NotificationService::NoDetails());
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
@ -343,7 +343,7 @@ TEST_F(UserScriptListenerTest, ResumeBeforeStart) {
|
||||
ASSERT_FALSE(request->is_pending());
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(profile_.get()),
|
||||
content::NotificationService::NoDetails());
|
||||
base::MessageLoop::current()->RunUntilIdle();
|
||||
|
@ -350,7 +350,8 @@ UserScriptMaster::UserScriptMaster(Profile* profile)
|
||||
extension_registry_observer_(this),
|
||||
weak_factory_(this) {
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(profile_));
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::Source<Profile>(profile_));
|
||||
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
|
||||
content::NotificationService::AllBrowserContextsAndSources());
|
||||
@ -396,7 +397,7 @@ void UserScriptMaster::OnScriptsLoaded(
|
||||
changed_extensions_.clear();
|
||||
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::Source<Profile>(profile_),
|
||||
content::Details<base::SharedMemory>(shared_memory_.get()));
|
||||
}
|
||||
@ -438,7 +439,7 @@ void UserScriptMaster::Observe(int type,
|
||||
const content::NotificationDetails& details) {
|
||||
bool should_start_load = false;
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSIONS_READY:
|
||||
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED:
|
||||
extensions_service_ready_ = true;
|
||||
should_start_load = true;
|
||||
break;
|
||||
|
@ -46,7 +46,8 @@ class UserScriptMasterTest : public testing::Test,
|
||||
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
|
||||
|
||||
// Register for all user script notifications.
|
||||
registrar_.Add(this, chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_USER_SCRIPTS_UPDATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
// UserScriptMaster posts tasks to the file thread so make the current
|
||||
@ -65,7 +66,7 @@ class UserScriptMasterTest : public testing::Test,
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
DCHECK(type == chrome::NOTIFICATION_USER_SCRIPTS_UPDATED);
|
||||
DCHECK(type == extensions::NOTIFICATION_USER_SCRIPTS_UPDATED);
|
||||
|
||||
shared_memory_ = content::Details<base::SharedMemory>(details).ptr();
|
||||
if (base::MessageLoop::current() == &message_loop_)
|
||||
|
@ -290,7 +290,8 @@ WebstoreInstaller::WebstoreInstaller(Profile* profile,
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(web_contents);
|
||||
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
|
||||
content::Source<CrxInstaller>(NULL));
|
||||
extension_registry_observer_.Add(ExtensionRegistry::Get(profile));
|
||||
}
|
||||
@ -360,7 +361,7 @@ void WebstoreInstaller::Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
case extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
|
||||
CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr();
|
||||
CHECK(crx_installer);
|
||||
if (crx_installer != crx_installer_.get())
|
||||
|
@ -244,9 +244,10 @@ class CommandLineWebstoreInstall : public WebstoreStartupInstallerTest,
|
||||
|
||||
virtual void SetUpOnMainThread() OVERRIDE {
|
||||
WebstoreStartupInstallerTest::SetUpOnMainThread();
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
@ -259,7 +260,8 @@ class CommandLineWebstoreInstall : public WebstoreStartupInstallerTest,
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
if (type == chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED) {
|
||||
if (type ==
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED) {
|
||||
const Extension* extension =
|
||||
content::Details<const extensions::InstalledExtensionInfo>(details)->
|
||||
extension;
|
||||
|
@ -126,7 +126,8 @@ class FirstRunDelayedTasks : public content::NotificationObserver {
|
||||
|
||||
explicit FirstRunDelayedTasks(Tasks task) {
|
||||
if (task == INSTALL_EXTENSIONS) {
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED,
|
||||
@ -137,7 +138,7 @@ class FirstRunDelayedTasks : public content::NotificationObserver {
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE {
|
||||
// After processing the notification we always delete ourselves.
|
||||
if (type == chrome::NOTIFICATION_EXTENSIONS_READY) {
|
||||
if (type == extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED) {
|
||||
Profile* profile = content::Source<Profile>(source).ptr();
|
||||
ExtensionService* service =
|
||||
extensions::ExtensionSystem::Get(profile)->extension_service();
|
||||
|
@ -33,7 +33,7 @@ class InfoBarsTest : public InProcessBrowserTest {
|
||||
browser()->profile())->extension_service();
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt(
|
||||
|
@ -17,7 +17,8 @@ NotificationSystemObserver::NotificationSystemObserver(
|
||||
DCHECK(ui_manager_);
|
||||
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
|
||||
content::NotificationService::AllSources());
|
||||
@ -32,7 +33,7 @@ void NotificationSystemObserver::Observe(
|
||||
const content::NotificationDetails& details) {
|
||||
if (type == chrome::NOTIFICATION_APP_TERMINATING) {
|
||||
ui_manager_->CancelAll();
|
||||
} else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED) {
|
||||
} else if (type == extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED) {
|
||||
if (!content::Source<Profile>(source)->IsOffTheRecord()) {
|
||||
extensions::UnloadedExtensionInfo* extension_info =
|
||||
content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
|
||||
|
@ -229,17 +229,21 @@ void PerformanceMonitor::RegisterForNotifications() {
|
||||
DCHECK(database_logging_enabled_);
|
||||
|
||||
// Extensions
|
||||
registrar_.Add(
|
||||
this,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_ENABLED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
registrar_.Add(this,
|
||||
extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
// Crashes
|
||||
@ -556,19 +560,19 @@ void PerformanceMonitor::Observe(int type,
|
||||
DCHECK(database_logging_enabled_);
|
||||
|
||||
switch (type) {
|
||||
case chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
|
||||
AddExtensionEvent(
|
||||
EVENT_EXTENSION_INSTALL,
|
||||
content::Details<const extensions::InstalledExtensionInfo>(details)->
|
||||
extension);
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_ENABLED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_ENABLED: {
|
||||
AddExtensionEvent(EVENT_EXTENSION_ENABLE,
|
||||
content::Details<Extension>(details).ptr());
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
|
||||
const UnloadedExtensionInfo* info =
|
||||
content::Details<UnloadedExtensionInfo>(details).ptr();
|
||||
|
||||
@ -579,7 +583,7 @@ void PerformanceMonitor::Observe(int type,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_CRX_INSTALLER_DONE: {
|
||||
case extensions::NOTIFICATION_CRX_INSTALLER_DONE: {
|
||||
const extensions::CrxInstaller* installer =
|
||||
content::Source<extensions::CrxInstaller>(source).ptr();
|
||||
const extensions::Extension* extension =
|
||||
@ -593,7 +597,7 @@ void PerformanceMonitor::Observe(int type,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED: {
|
||||
case extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED: {
|
||||
AddExtensionEvent(EVENT_EXTENSION_UNINSTALL,
|
||||
content::Details<Extension>(details).ptr());
|
||||
break;
|
||||
|
@ -508,7 +508,7 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UpdateExtensionEvent) {
|
||||
|
||||
// Create an observer to wait for the update to finish.
|
||||
content::WindowedNotificationObserver windowed_observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::Source<extensions::CrxInstaller>(crx_installer));
|
||||
ASSERT_TRUE(extension_service->UpdateExtension(
|
||||
extension->id(), path_v2_, true, &crx_installer));
|
||||
|
@ -672,7 +672,7 @@ class PolicyTest : public InProcessBrowserTest {
|
||||
installer->set_creation_flags(extensions::Extension::FROM_WEBSTORE);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
||||
content::NotificationService::AllSources());
|
||||
installer->InstallCrx(extension_path);
|
||||
observer.Wait();
|
||||
@ -687,8 +687,8 @@ class PolicyTest : public InProcessBrowserTest {
|
||||
scoped_refptr<extensions::UnpackedInstaller> installer =
|
||||
extensions::UnpackedInstaller::Create(extension_service());
|
||||
content::WindowedNotificationObserver observer(
|
||||
expect_success ? chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED
|
||||
: chrome::NOTIFICATION_EXTENSION_LOAD_ERROR,
|
||||
expect_success ? extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED
|
||||
: extensions::NOTIFICATION_EXTENSION_LOAD_ERROR,
|
||||
content::NotificationService::AllSources());
|
||||
installer->Load(extension_path);
|
||||
observer.Wait();
|
||||
@ -705,8 +705,9 @@ class PolicyTest : public InProcessBrowserTest {
|
||||
|
||||
void UninstallExtension(const std::string& id, bool expect_success) {
|
||||
content::WindowedNotificationObserver observer(
|
||||
expect_success ? chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED
|
||||
: chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
|
||||
expect_success
|
||||
? extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED
|
||||
: extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
|
||||
content::NotificationService::AllSources());
|
||||
extension_service()->UninstallExtension(
|
||||
id,
|
||||
@ -1621,7 +1622,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallForcelist) {
|
||||
policies.Set(key::kExtensionInstallForcelist, POLICY_LEVEL_MANDATORY,
|
||||
POLICY_SCOPE_USER, forcelist.DeepCopy(), NULL);
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
UpdateProviderPolicy(policies);
|
||||
observer.Wait();
|
||||
@ -1659,7 +1660,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallForcelist) {
|
||||
extensions::ExtensionUpdater::CheckParams params;
|
||||
params.install_immediately = true;
|
||||
content::WindowedNotificationObserver update_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
updater->CheckNow(params);
|
||||
update_observer.Wait();
|
||||
@ -1702,10 +1703,10 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallForcelist) {
|
||||
BackgroundContentsService::
|
||||
SetRestartDelayForForceInstalledAppsAndExtensionsForTesting(0);
|
||||
content::WindowedNotificationObserver extension_crashed_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
|
||||
content::NotificationService::AllSources());
|
||||
content::WindowedNotificationObserver extension_loaded_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
extensions::ExtensionHost* extension_host =
|
||||
extensions::ExtensionSystem::Get(browser()->profile())->
|
||||
@ -1789,7 +1790,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_ExtensionInstallSources) {
|
||||
UpdateProviderPolicy(policies);
|
||||
|
||||
content::WindowedNotificationObserver observer(
|
||||
chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
|
||||
content::NotificationService::AllSources());
|
||||
PerformClick(1, 0);
|
||||
observer.Wait();
|
||||
|
@ -348,7 +348,7 @@ TEST_F(SupervisedUserServiceExtensionTest, InstallContentPacks) {
|
||||
base::FilePath extension_path =
|
||||
test_data_dir.AppendASCII("extensions/supervised_user/content_pack");
|
||||
content::WindowedNotificationObserver extension_load_observer(
|
||||
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
|
||||
content::Source<Profile>(profile_.get()));
|
||||
installer->Load(extension_path);
|
||||
extension_load_observer.Wait();
|
||||
|
@ -25,7 +25,7 @@ ExtensionsActivityMonitor::ExtensionsActivityMonitor()
|
||||
// wanted to use the string name). Thus, we use all sources and filter in
|
||||
// Observe.
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
content::NotificationService::AllSources());
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ void FireBookmarksApiEvent(
|
||||
bookmarks_function->set_name(T::function_name());
|
||||
for (int i = 0; i < repeats; i++) {
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
|
||||
content::Source<Extension>(extension.get()),
|
||||
content::Details<const extensions::BookmarksFunction>(
|
||||
bookmarks_function.get()));
|
||||
|
@ -15,7 +15,7 @@ SyncedExtensionInstaller::SyncedExtensionInstaller(Profile* profile)
|
||||
weak_ptr_factory_(this) {
|
||||
DoInstallSyncedExtensions();
|
||||
registrar_.Add(this,
|
||||
chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
|
||||
content::Source<Profile>(profile_));
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ void SyncedExtensionInstaller::Observe(
|
||||
int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) {
|
||||
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, type);
|
||||
DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, type);
|
||||
|
||||
// The extension system is trying to check for updates. In the real world,
|
||||
// this would be where synced extensions are asynchronously downloaded from
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user