diff options
Diffstat (limited to 'chrome/browser/extensions')
69 files changed, 242 insertions, 220 deletions
diff --git a/chrome/browser/extensions/app_notification_manager.cc b/chrome/browser/extensions/app_notification_manager.cc index 84d5658..2b77004 100644 --- a/chrome/browser/extensions/app_notification_manager.cc +++ b/chrome/browser/extensions/app_notification_manager.cc @@ -11,7 +11,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" AppNotificationManager::AppNotificationManager(Profile* profile) : profile_(profile) { @@ -139,7 +139,7 @@ void AppNotificationManager::HandleLoadResults(const NotificationMap& map) { notifications_[id].insert(notifications_[id].begin(), list.begin(), list.end()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, content::Source<Profile>(profile_), content::Details<const std::string>(&id)); diff --git a/chrome/browser/extensions/app_notification_manager_unittest.cc b/chrome/browser/extensions/app_notification_manager_unittest.cc index ab908e6..f405b91 100644 --- a/chrome/browser/extensions/app_notification_manager_unittest.cc +++ b/chrome/browser/extensions/app_notification_manager_unittest.cc @@ -9,7 +9,7 @@ #include "chrome/common/extensions/extension_test_util.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/testing_profile.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "testing/gtest/include/gtest/gtest.h" @@ -109,7 +109,7 @@ TEST_F(AppNotificationManagerTest, MAYBE_ExtensionUninstall) { util::ExpectListsEqual(list2, *mgr_->GetAll(id2)); // Send the uninstall notification for extension id1. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNINSTALLED, content::Source<Profile>(profile_.get()), content::Details<const std::string>(&id1)); diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index 7f7ba77..4382c4d 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -16,6 +16,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/notification_service.h" #include "net/base/mock_host_resolver.h" class AppApiTest : public ExtensionApiTest { @@ -39,7 +40,8 @@ static void WindowOpenHelper(Browser* browser, const GURL& url, bool newtab_process_should_equal_opener) { ui_test_utils::WindowedNotificationObserver observer( - content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources()); + content::NOTIFICATION_LOAD_STOP, + content::NotificationService::AllSources()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( opener_host, L"", L"window.open('" + UTF8ToWide(url.spec()) + L"');")); @@ -63,7 +65,7 @@ static void NavigateTabHelper(TabContents* contents, const GURL& url) { bool result = false; ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - NotificationService::AllSources()); + content::NotificationService::AllSources()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( contents->render_view_host(), L"", L"window.addEventListener('unload', function() {" @@ -428,7 +430,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenWebPopupFromWebIframe) { ASSERT_TRUE(app); ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - NotificationService::AllSources()); + content::NotificationService::AllSources()); ui_test_utils::NavigateToURLWithDisposition( browser(), base_url.Resolve("path1/container.html"), diff --git a/chrome/browser/extensions/apps_promo.cc b/chrome/browser/extensions/apps_promo.cc index dd226da..6fd273c 100644 --- a/chrome/browser/extensions/apps_promo.cc +++ b/chrome/browser/extensions/apps_promo.cc @@ -15,7 +15,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/common/url_constants.h" #include "net/base/load_flags.h" #include "net/url_request/url_request_status.h" @@ -388,10 +388,10 @@ bool AppsPromoLogoFetcher::HaveCachedLogo() { void AppsPromoLogoFetcher::SavePromo() { AppsPromo::SetPromo(promo_data_); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } bool AppsPromoLogoFetcher::SupportsLogoURL() { diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc index 191f6ed..bf6fbf1 100644 --- a/chrome/browser/extensions/browser_action_apitest.cc +++ b/chrome/browser/extensions/browser_action_apitest.cc @@ -21,6 +21,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/notification_service.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -38,7 +39,7 @@ class BrowserActionApiTest : public ExtensionApiTest { ResultCatcher catcher; ui_test_utils::WindowedNotificationObserver popup_observer( chrome::NOTIFICATION_EXTENSION_POPUP_VIEW_READY, - NotificationService::AllSources()); + content::NotificationService::AllSources()); GetBrowserActionsBar().Press(index); popup_observer.Wait(); EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); @@ -397,7 +398,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_CloseBackgroundPage) { ui_test_utils::WindowedNotificationObserver host_destroyed_observer( chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); // Click the browser action. browser()->profile()->GetExtensionService()->browser_event_router()-> diff --git a/chrome/browser/extensions/convert_web_app_browsertest.cc b/chrome/browser/extensions/convert_web_app_browsertest.cc index 440a454..3210d58 100644 --- a/chrome/browser/extensions/convert_web_app_browsertest.cc +++ b/chrome/browser/extensions/convert_web_app_browsertest.cc @@ -15,6 +15,7 @@ #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" class ExtensionFromWebAppTest : public InProcessBrowserTest, public content::NotificationObserver { @@ -53,7 +54,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionFromWebAppTest, Basic) { content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); expected_extension_id_ = "fnpgoaochgbdfjndakichfafiocjjpmm"; ui_test_utils::NavigateToURL( diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 86ea255..614757f 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -34,7 +34,7 @@ #include "chrome/common/extensions/extension_file_util.h" #include "content/browser/browser_thread.h" #include "content/browser/user_metrics.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -444,10 +444,11 @@ void CrxInstaller::InstallUIAbort(bool user_initiated) { extension_, histogram_name.c_str()); // Kill the theme loading bubble. - NotificationService* service = NotificationService::current(); + content::NotificationService* service = + content::NotificationService::current(); service->Notify(chrome::NOTIFICATION_NO_THEME_DETECTED, content::Source<CrxInstaller>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); Release(); // balanced in ConfirmInstall(). NotifyCrxInstallComplete(); @@ -518,7 +519,8 @@ void CrxInstaller::ReportFailureFromFileThread(const std::string& error) { void CrxInstaller::ReportFailureFromUIThread(const std::string& error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - NotificationService* service = NotificationService::current(); + content::NotificationService* service = + content::NotificationService::current(); service->Notify(chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, content::Source<CrxInstaller>(this), content::Details<const std::string>(&error)); @@ -594,8 +596,8 @@ void CrxInstaller::NotifyCrxInstallComplete() { // is problematic because they don't know anything about the // extension before it is unpacked, so they can not filter based // on the extension. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::Source<CrxInstaller>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc index e8645d9..f71b869 100644 --- a/chrome/browser/extensions/execute_code_in_tab_function.cc +++ b/chrome/browser/extensions/execute_code_in_tab_function.cc @@ -24,7 +24,6 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" namespace keys = extension_tabs_module_constants; diff --git a/chrome/browser/extensions/extension_accessibility_api.cc b/chrome/browser/extensions/extension_accessibility_api.cc index 08e3a59..731b81e 100644 --- a/chrome/browser/extensions/extension_accessibility_api.cc +++ b/chrome/browser/extensions/extension_accessibility_api.cc @@ -17,7 +17,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace keys = extension_accessibility_api_constants; @@ -43,28 +43,28 @@ ExtensionAccessibilityEventRouter::ExtensionAccessibilityEventRouter() : enabled_(false) { registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_WINDOW_OPENED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_WINDOW_CLOSED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_ACTION, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_TEXT_CHANGED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_ACCESSIBILITY_VOLUME_CHANGED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ExtensionAccessibilityEventRouter::~ExtensionAccessibilityEventRouter() { diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index b6c0d10..0631151 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -13,6 +13,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_registrar.h" +#include "content/public/browser/notification_service.h" namespace { @@ -28,9 +29,9 @@ ExtensionApiTest::ResultCatcher::ResultCatcher() : profile_restriction_(NULL), waiting_(false) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_PASSED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_FAILED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ExtensionApiTest::ResultCatcher::~ResultCatcher() { diff --git a/chrome/browser/extensions/extension_app_api.cc b/chrome/browser/extensions/extension_app_api.cc index dd7506c..e301795 100644 --- a/chrome/browser/extensions/extension_app_api.cc +++ b/chrome/browser/extensions/extension_app_api.cc @@ -10,6 +10,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" +#include "content/public/browser/notification_service.h" const char kBodyTextKey[] = "bodyText"; const char kExtensionIdKey[] = "extensionId"; @@ -70,7 +71,7 @@ bool AppNotifyFunction::RunImpl() { manager->Add(id, item.release()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, content::Source<Profile>(profile_), content::Details<const std::string>(&id)); @@ -92,7 +93,7 @@ bool AppClearAllNotificationsFunction::RunImpl() { AppNotificationManager* manager = profile()->GetExtensionService()->app_notification_manager(); manager->ClearAll(id); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, content::Source<Profile>(profile_), content::Details<const std::string>(&id)); diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index 21f6607..19d23f2 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -34,7 +34,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -79,15 +79,16 @@ void BookmarksFunction::Run() { BookmarkModel* model = profile()->GetBookmarkModel(); if (!model->IsLoaded()) { // Bookmarks are not ready yet. We'll wait. - registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, - NotificationService::AllBrowserContextsAndSources()); + registrar_.Add( + this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, + content::NotificationService::AllBrowserContextsAndSources()); AddRef(); // Balanced in Observe(). return; } bool success = RunImpl(); if (success) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED, content::Source<const Extension>(GetExtension()), content::Details<const BookmarksFunction>(this)); diff --git a/chrome/browser/extensions/extension_browser_actions_api.cc b/chrome/browser/extensions/extension_browser_actions_api.cc index 31ae81f..0a37658 100644 --- a/chrome/browser/extensions/extension_browser_actions_api.cc +++ b/chrome/browser/extensions/extension_browser_actions_api.cc @@ -11,7 +11,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/render_messages.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace { // Errors. @@ -38,10 +38,10 @@ bool BrowserActionFunction::RunImpl() { if (!RunBrowserAction()) return false; - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, content::Source<ExtensionAction>(browser_action_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); return true; } diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index 6b7b6bb..af3e5db 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -20,7 +20,7 @@ #include "chrome/common/extensions/extension_constants.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace events = extension_event_names; namespace tab_keys = extension_tabs_module_constants; @@ -75,7 +75,7 @@ void ExtensionBrowserEventRouter::Init() { // Needed for when no suitable window can be passed to an extension as the // currently focused window. registrar_.Add(this, content::NOTIFICATION_NO_KEY_WINDOW, - NotificationService::AllSources()); + content::NotificationService::AllSources()); #endif // Init() can happen after the browser is running, so catch up with any diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 8898459..f96fd61 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -27,7 +27,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" ExtensionBrowserTest::ExtensionBrowserTest() : loaded_(false), @@ -65,7 +65,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithOptions( { content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); service->LoadExtension(path, false); ui_test_utils::RunMessageLoop(); } @@ -242,13 +242,13 @@ bool ExtensionBrowserTest::InstallOrUpdateExtension(const std::string& id, { content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, - NotificationService::AllSources()); + content::NotificationService::AllSources()); ExtensionInstallUI* install_ui = NULL; if (ui_type == INSTALL_UI_TYPE_CANCEL) @@ -303,7 +303,7 @@ void ExtensionBrowserTest::ReloadExtension(const std::string& extension_id) { service->ReloadExtension(extension_id); ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } void ExtensionBrowserTest::UnloadExtension(const std::string& extension_id) { @@ -333,7 +333,7 @@ bool ExtensionBrowserTest::WaitForPageActionCountChangeTo(int count) { target_page_action_count_ = count; ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } return location_bar->PageActionCount() == count; } @@ -345,7 +345,7 @@ bool ExtensionBrowserTest::WaitForPageActionVisibilityChangeTo(int count) { target_visible_page_action_count_ = count; ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } return location_bar->PageActionVisibleCount() == count; } @@ -354,7 +354,7 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() { // Wait for all the extension hosts that exist to finish loading. content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, - NotificationService::AllSources()); + content::NotificationService::AllSources()); ExtensionProcessManager* manager = browser()->profile()->GetExtensionProcessManager(); @@ -378,7 +378,7 @@ bool ExtensionBrowserTest::WaitForExtensionInstall() { int before = extension_installs_observed_; ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); return extension_installs_observed_ == (before + 1); } @@ -386,13 +386,13 @@ bool ExtensionBrowserTest::WaitForExtensionInstallError() { int before = extension_installs_observed_; ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, - NotificationService::AllSources()); + content::NotificationService::AllSources()); return extension_installs_observed_ == before; } void ExtensionBrowserTest::WaitForExtensionLoad() { ui_test_utils::RegisterAndWait(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); WaitForExtensionHostsToLoad(); } @@ -406,7 +406,7 @@ bool ExtensionBrowserTest::WaitForExtensionCrash( } ui_test_utils::RegisterAndWait( this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); return (service->GetExtensionById(extension_id, true) == NULL); } diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 2b4f79a..c6ef3a0 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -26,6 +26,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/notification_service.h" #include "net/base/net_util.h" #include "net/test/test_server.h" @@ -614,7 +615,7 @@ static void WindowOpenHelper(Browser* browser, const GURL& start_url, ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - NotificationService::AllSources()); + content::NotificationService::AllSources()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( browser->GetSelectedTabContents()->render_view_host(), L"", L"window.open('" + UTF8ToWide(newtab_url) + L"');")); diff --git a/chrome/browser/extensions/extension_cookies_api.cc b/chrome/browser/extensions/extension_cookies_api.cc index aaa6067..7da0448 100644 --- a/chrome/browser/extensions/extension_cookies_api.cc +++ b/chrome/browser/extensions/extension_cookies_api.cc @@ -19,7 +19,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_error_utils.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/base/cookie_monster.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" @@ -35,7 +35,7 @@ void ExtensionCookiesEventRouter::Init() { CHECK(registrar_.IsEmpty()); registrar_.Add(this, chrome::NOTIFICATION_COOKIE_CHANGED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); } void ExtensionCookiesEventRouter::Observe( diff --git a/chrome/browser/extensions/extension_debugger_api.cc b/chrome/browser/extensions/extension_debugger_api.cc index ec39215..23890c9 100644 --- a/chrome/browser/extensions/extension_debugger_api.cc +++ b/chrome/browser/extensions/extension_debugger_api.cc @@ -26,7 +26,7 @@ #include "content/browser/debugger/devtools_manager.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/devtools_messages.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_source.h" namespace keys = extension_debugger_api_constants; diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc index 355daca..74dd20a 100644 --- a/chrome/browser/extensions/extension_event_router.cc +++ b/chrome/browser/extensions/extension_event_router.cc @@ -21,7 +21,7 @@ #include "chrome/common/extensions/extension_messages.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/renderer_host/render_process_host.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace { @@ -92,9 +92,9 @@ ExtensionEventRouter::ExtensionEventRouter(Profile* profile) : profile_(profile), extension_devtools_manager_(profile->GetExtensionDevToolsManager()) { registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, content::Source<Profile>(profile_)); // TODO(tessamac): also get notified for background page crash/failure. diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc index 5d6fd0f..cdae1f4 100644 --- a/chrome/browser/extensions/extension_history_api.cc +++ b/chrome/browser/extensions/extension_history_api.cc @@ -18,7 +18,8 @@ #include "chrome/browser/history/history_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace keys = extension_history_api_constants; diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 5fad93c..0f7fa9b 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -45,7 +45,7 @@ #include "content/browser/tab_contents/popup_menu_helper_mac.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/common/view_messages.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/native_web_keyboard_event.h" @@ -175,7 +175,7 @@ ExtensionHost::ExtensionHost(const Extension* extension, } ExtensionHost::~ExtensionHost() { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -298,7 +298,7 @@ void ExtensionHost::Observe(int type, NavigateToURL(url_); break; case content::NOTIFICATION_RENDERER_PROCESS_CREATED: - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_PROCESS_CREATED, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -346,7 +346,7 @@ void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host, // and they aren't all going to use ExtensionHost. This should be in someplace // more central, like EPM maybe. DCHECK_EQ(render_view_host_, render_view_host); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -388,7 +388,7 @@ void ExtensionHost::DidStopLoading() { #endif } if (notify) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -431,7 +431,7 @@ void ExtensionHost::DocumentAvailableInMainFrame(RenderViewHost* rvh) { void ExtensionHost::DocumentOnLoadCompletedInMainFrame(RenderViewHost* rvh, int32 page_id) { if (chrome::VIEW_TYPE_EXTENSION_POPUP == GetRenderViewType()) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_POPUP_VIEW_READY, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -503,7 +503,7 @@ void ExtensionHost::Close(RenderViewHost* render_view_host) { extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); @@ -572,7 +572,7 @@ void ExtensionHost::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP) { if (event.type == NativeWebKeyboardEvent::RawKeyDown && event.windowsKeyCode == ui::VKEY_ESCAPE) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, content::Source<Profile>(profile_), content::Details<ExtensionHost>(this)); diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc index 86012cb..6621675 100644 --- a/chrome/browser/extensions/extension_input_api.cc +++ b/chrome/browser/extensions/extension_input_api.cc @@ -20,7 +20,7 @@ #include "views/widget/widget.h" #if defined(USE_VIRTUAL_KEYBOARD) -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #endif #if defined(OS_CHROMEOS) && defined(TOUCH_UI) @@ -166,10 +166,10 @@ bool SendKeyboardEventInputFunction::RunImpl() { #if defined(USE_VIRTUAL_KEYBOARD) bool HideKeyboardFunction::RunImpl() { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_HIDE_KEYBOARD_INVOKED, content::Source<HideKeyboardFunction>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); return true; } @@ -185,7 +185,7 @@ bool SetKeyboardHeightFunction::RunImpl() { // TODO(penghuang) Check the height is not greater than height of browser view // and set the height of virtual keyboard directly instead of using // notification. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_SET_KEYBOARD_HEIGHT_INVOKED, content::Source<SetKeyboardHeightFunction>(this), content::Details<int>(&height)); diff --git a/chrome/browser/extensions/extension_input_method_apitest.cc b/chrome/browser/extensions/extension_input_method_apitest.cc index b04d820..a019386 100644 --- a/chrome/browser/extensions/extension_input_method_apitest.cc +++ b/chrome/browser/extensions/extension_input_method_apitest.cc @@ -11,7 +11,7 @@ #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -27,7 +27,7 @@ class SetInputMethodListener : public content::NotificationObserver { // Creates listener, which should reply exactly |count_| times. explicit SetInputMethodListener(int count) : count_(count) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } virtual ~SetInputMethodListener() { diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index 25466a6..409e6dd 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -33,7 +33,7 @@ #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/extensions/url_pattern.h" #include "chrome/common/url_constants.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -323,10 +323,11 @@ void ExtensionInstallUI::OnImageLoaded( case PERMISSIONS_PROMPT: case RE_ENABLE_PROMPT: case INSTALL_PROMPT: { - NotificationService* service = NotificationService::current(); + content::NotificationService* service = + content::NotificationService::current(); service->Notify(chrome::NOTIFICATION_EXTENSION_WILL_SHOW_CONFIRM_DIALOG, content::Source<ExtensionInstallUI>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); Prompt prompt(prompt_type_); prompt.SetPermissions(permissions_->GetWarningMessages()); @@ -347,7 +348,7 @@ void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser, browser->GetSingletonTabNavigateParams(GURL(chrome::kChromeUINewTabURL)); browser::Navigate(¶ms); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_APP_INSTALLED_TO_NTP, content::Source<TabContents>(params.target_contents->tab_contents()), content::Details<const std::string>(&app_id)); diff --git a/chrome/browser/extensions/extension_management_api.cc b/chrome/browser/extensions/extension_management_api.cc index 06c846d..fdf215b 100644 --- a/chrome/browser/extensions/extension_management_api.cc +++ b/chrome/browser/extensions/extension_management_api.cc @@ -27,7 +27,8 @@ #include "chrome/common/extensions/extension_error_utils.h" #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/extensions/url_pattern.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" using base::IntToString; namespace events = extension_event_names; diff --git a/chrome/browser/extensions/extension_management_browsertest.cc b/chrome/browser/extensions/extension_management_browsertest.cc index 2f33502..1bae8ee 100644 --- a/chrome/browser/extensions/extension_management_browsertest.cc +++ b/chrome/browser/extensions/extension_management_browsertest.cc @@ -21,6 +21,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/public/browser/notification_service.h" class ExtensionManagementTest : public ExtensionBrowserTest { protected: @@ -236,7 +237,8 @@ class NotificationListener : public content::NotificationObserver { chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND }; for (size_t i = 0; i < arraysize(types); i++) { - registrar_.Add(this, types[i], NotificationService::AllSources()); + registrar_.Add( + this, types[i], content::NotificationService::AllSources()); } } ~NotificationListener() {} diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc index 1ac320f..d69539e 100644 --- a/chrome/browser/extensions/extension_menu_manager.cc +++ b/chrome/browser/extensions/extension_menu_manager.cc @@ -17,7 +17,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" #include "ui/base/text/text_elider.h" #include "ui/gfx/favicon_size.h" #include "webkit/glue/context_menu.h" diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc index 5492626..0a4cfc0 100644 --- a/chrome/browser/extensions/extension_menu_manager_unittest.cc +++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc @@ -19,7 +19,7 @@ #include "chrome/common/extensions/extension_constants.h" #include "chrome/test/base/testing_profile.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/context_menu.h" @@ -311,7 +311,8 @@ TEST_F(ExtensionMenuManagerTest, ChangeParent) { // Tests that we properly remove an extension's menu item when that extension is // unloaded. TEST_F(ExtensionMenuManagerTest, ExtensionUnloadRemovesMenuItems) { - NotificationService* notifier = NotificationService::current(); + content::NotificationService* notifier = + content::NotificationService::current(); ASSERT_TRUE(notifier != NULL); // Create a test extension. diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc index c90ca5c..f1febd7 100644 --- a/chrome/browser/extensions/extension_message_service.cc +++ b/chrome/browser/extensions/extension_message_service.cc @@ -19,7 +19,7 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" // Since we have 2 ports for every channel, we just index channels by half the @@ -117,11 +117,11 @@ void ExtensionMessageService::AllocatePortIdPair(int* port1, int* port2) { ExtensionMessageService::ExtensionMessageService(Profile* profile) : profile_(profile) { registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); } ExtensionMessageService::~ExtensionMessageService() { diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc index 36a1336..c4c867e 100644 --- a/chrome/browser/extensions/extension_messages_apitest.cc +++ b/chrome/browser/extensions/extension_messages_apitest.cc @@ -7,7 +7,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "googleurl/src/gurl.h" namespace { @@ -16,7 +16,7 @@ class MessageSender : public content::NotificationObserver { public: MessageSender() { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } private: diff --git a/chrome/browser/extensions/extension_metrics_apitest.cc b/chrome/browser/extensions/extension_metrics_apitest.cc index 3809c7a..f96d4ac 100644 --- a/chrome/browser/extensions/extension_metrics_apitest.cc +++ b/chrome/browser/extensions/extension_metrics_apitest.cc @@ -9,7 +9,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace { @@ -86,7 +86,7 @@ class UserActionObserver : public content::NotificationObserver { UserActionObserver::UserActionObserver() { registrar_.Add(this, content::NOTIFICATION_USER_ACTION, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } void UserActionObserver::Observe(int type, diff --git a/chrome/browser/extensions/extension_navigation_observer.cc b/chrome/browser/extensions/extension_navigation_observer.cc index f093c62..a08a9ec 100644 --- a/chrome/browser/extensions/extension_navigation_observer.cc +++ b/chrome/browser/extensions/extension_navigation_observer.cc @@ -8,7 +8,7 @@ #include "chrome/browser/profiles/profile.h" #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/navigation_entry.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" ExtensionNavigationObserver::ExtensionNavigationObserver(Profile* profile) : profile_(profile) { @@ -37,7 +37,7 @@ void ExtensionNavigationObserver::Observe( void ExtensionNavigationObserver::RegisterForNotifications() { registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } void ExtensionNavigationObserver::PromptToEnableExtensionIfNecessary( diff --git a/chrome/browser/extensions/extension_omnibox_api.cc b/chrome/browser/extensions/extension_omnibox_api.cc index e51939e..25e1bbd 100644 --- a/chrome/browser/extensions/extension_omnibox_api.cc +++ b/chrome/browser/extensions/extension_omnibox_api.cc @@ -17,7 +17,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension_constants.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace events { const char kOnInputStarted[] = "omnibox.onInputStarted"; @@ -99,9 +99,10 @@ void ExtensionOmniboxEventRouter::OnInputEntered( profile->GetExtensionEventRouter()->DispatchEventToExtension( extension_id, events::kOnInputEntered, json_args, profile, GURL()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED, - content::Source<Profile>(profile), NotificationService::NoDetails()); + content::Source<Profile>(profile), + content::NotificationService::NoDetails()); } // static @@ -140,7 +141,7 @@ bool OmniboxSendSuggestionsFunction::RunImpl() { } } - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY, content::Source<Profile>(profile_), content::Details<ExtensionOmniboxSuggestions>(&suggestions)); @@ -171,10 +172,10 @@ bool OmniboxSetDefaultSuggestionFunction::RunImpl() { profile_->GetExtensionService()->GetPropertyBag(GetExtension()), suggestion); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); return true; } diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc index ed74ae1..2e96c73c 100644 --- a/chrome/browser/extensions/extension_omnibox_apitest.cc +++ b/chrome/browser/extensions/extension_omnibox_apitest.cc @@ -23,6 +23,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/notification_service.h" #if defined(TOOLKIT_GTK) #include "chrome/browser/ui/gtk/browser_window_gtk.h" @@ -66,7 +67,7 @@ class OmniboxApiTest : public ExtensionApiTest { void WaitForTemplateURLServiceToLoad() { ui_test_utils::WindowedNotificationObserver loaded_observer( chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(browser()->profile()); model->Load(); diff --git a/chrome/browser/extensions/extension_permissions_api.cc b/chrome/browser/extensions/extension_permissions_api.cc index 2c652ad..b6ce293 100644 --- a/chrome/browser/extensions/extension_permissions_api.cc +++ b/chrome/browser/extensions/extension_permissions_api.cc @@ -16,7 +16,7 @@ #include "chrome/common/extensions/extension_messages.h" #include "chrome/common/extensions/extension_permission_set.h" #include "chrome/common/extensions/url_pattern_set.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "googleurl/src/gurl.h" namespace { @@ -212,7 +212,7 @@ void ExtensionPermissionsManager::NotifyPermissionsUpdated( // Notify other APIs or interested parties. UpdatedExtensionPermissionsInfo info = UpdatedExtensionPermissionsInfo( extension, changed, reason); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED, content::Source<Profile>(extension_service_->profile()), content::Details<UpdatedExtensionPermissionsInfo>(&info)); diff --git a/chrome/browser/extensions/extension_permissions_api.h b/chrome/browser/extensions/extension_permissions_api.h index a844065..7644a6a 100644 --- a/chrome/browser/extensions/extension_permissions_api.h +++ b/chrome/browser/extensions/extension_permissions_api.h @@ -12,7 +12,6 @@ #include "chrome/common/extensions/extension_permission_set.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_process_host.h" -#include "content/common/notification_service.h" namespace base { class DictionaryValue; diff --git a/chrome/browser/extensions/extension_preference_api.cc b/chrome/browser/extensions/extension_preference_api.cc index 8d9291a..871d99b 100644 --- a/chrome/browser/extensions/extension_preference_api.cc +++ b/chrome/browser/extensions/extension_preference_api.cc @@ -23,7 +23,8 @@ #include "chrome/common/extensions/extension_error_utils.h" #include "chrome/common/extensions/extension_permission_set.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace { diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index 3c4ee0b..c5f03f2 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -15,7 +15,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/url_pattern.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" using base::Time; @@ -1124,7 +1124,7 @@ void ExtensionPrefs::SetBrowserActionVisibility(const Extension* extension, UpdateExtensionPref(extension->id(), kBrowserActionVisible, Value::CreateBooleanValue(visible)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, content::Source<ExtensionPrefs>(this), content::Details<const Extension>(extension)); @@ -1458,10 +1458,10 @@ void ExtensionPrefs::SetAppLauncherOrder( for (size_t i = 0; i < extension_ids.size(); ++i) SetAppLaunchIndex(extension_ids.at(i), i); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED, content::Source<ExtensionPrefs>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } int ExtensionPrefs::GetPageIndex(const std::string& extension_id) { diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index c27c240..263ced9 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -24,7 +24,7 @@ #include "content/browser/browser_thread.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace { @@ -108,9 +108,9 @@ ExtensionProcessManager::ExtensionProcessManager(Profile* profile) // We can listen to everything for SITE_INSTANCE_DELETED because we check the // |site_instance_id| in UnregisterExtensionSiteInstance. registrar_.Add(this, content::NOTIFICATION_SITE_INSTANCE_DELETED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ExtensionProcessManager::~ExtensionProcessManager() { @@ -467,7 +467,7 @@ void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, all_hosts_.insert(host); if (is_background) background_hosts_.insert(host); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_CREATED, content::Source<ExtensionProcessManager>(this), content::Details<ExtensionHost>(host)); @@ -493,7 +493,7 @@ IncognitoExtensionProcessManager::IncognitoExtensionProcessManager( DCHECK(profile->IsOffTheRecord()); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ExtensionHost* IncognitoExtensionProcessManager::CreateViewHost( diff --git a/chrome/browser/extensions/extension_save_page_api.cc b/chrome/browser/extensions/extension_save_page_api.cc index 39f226b..5942206 100644 --- a/chrome/browser/extensions/extension_save_page_api.cc +++ b/chrome/browser/extensions/extension_save_page_api.cc @@ -12,7 +12,8 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/download/mhtml_generation_manager.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" // Error messages. diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index a49a1f8..2e990da 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -91,7 +91,7 @@ #include "content/browser/plugin_service.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/user_metrics.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/common/pepper_plugin_registry.h" #include "content/public/browser/notification_types.h" #include "googleurl/src/gurl.h" @@ -616,11 +616,11 @@ ExtensionService::ExtensionService(Profile* profile, } registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); pref_change_registrar_.Init(profile->GetPrefs()); pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, this); pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, this); @@ -891,7 +891,7 @@ bool ExtensionService::UninstallExtension( // managed extensions. if (!Extension::UserMayDisable(extension->location()) && !external_uninstall) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, content::Source<Profile>(profile_), content::Details<const Extension>(extension)); @@ -959,7 +959,7 @@ bool ExtensionService::UninstallExtension( UntrackTerminatedExtension(extension_id); // Notify interested parties that we've uninstalled this extension. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNINSTALLED, content::Source<Profile>(profile_), content::Details<const std::string>(&extension_id)); @@ -1473,7 +1473,7 @@ void ExtensionService::NotifyExtensionLoaded(const Extension* extension) { // Tell subsystems that use the EXTENSION_LOADED notification about the new // extension. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_LOADED, content::Source<Profile>(profile_), content::Details<const Extension>(extension)); @@ -1587,7 +1587,7 @@ void ExtensionService::NotifyExtensionUnloaded( const Extension* extension, extension_misc::UnloadedExtensionReason reason) { UnloadedExtensionInfo details(extension, reason); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNLOADED, content::Source<Profile>(profile_), content::Details<UnloadedExtensionInfo>(&details)); @@ -2277,7 +2277,7 @@ void ExtensionService::UnloadExtension( UnloadedExtensionInfo details(extension, reason); details.already_disabled = true; disabled_extensions_.erase(iter); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNLOADED, content::Source<Profile>(profile_), content::Details<UnloadedExtensionInfo>(&details)); @@ -2349,10 +2349,10 @@ void ExtensionService::OnLoadedInstalledExtensions() { } ready_ = true; - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSIONS_READY, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } void ExtensionService::AddExtension(const Extension* extension) { @@ -2390,7 +2390,7 @@ void ExtensionService::AddExtension(const Extension* extension) { // TODO(aa): This seems dodgy. It seems that AddExtension() could get called // with a disabled extension for other reasons other than that an update was // disabled. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, content::Source<Profile>(profile_), content::Details<const Extension>(extension)); @@ -2558,7 +2558,7 @@ void ExtensionService::OnExtensionInstalled( << " and update URL " << extension->update_url().spec() << "; not installing"; - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_INSTALL_NOT_ALLOWED, content::Source<Profile>(profile_), content::Details<const Extension>(extension)); @@ -2609,7 +2609,7 @@ void ExtensionService::OnExtensionInstalled( extension_prefs_->SetDelaysNetworkRequests( extension->id(), extension->ImplicitlyDelaysNetworkStartup()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_INSTALLED, content::Source<Profile>(profile_), content::Details<const Extension>(extension)); @@ -2783,7 +2783,8 @@ void ExtensionService::ReportExtensionLoadError( const FilePath& extension_path, const std::string &error, bool be_noisy) { - NotificationService* service = NotificationService::current(); + content::NotificationService* service = + content::NotificationService::current(); service->Notify(chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, content::Source<Profile>(profile_), content::Details<const std::string>(&error)); @@ -2918,10 +2919,10 @@ bool ExtensionService::IsBackgroundPageReady(const Extension* extension) { void ExtensionService::SetBackgroundPageReady(const Extension* extension) { DCHECK(!extension->background_url().is_empty()); extension_runtime_data_[extension->id()].background_page_ready = true; - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, content::Source<const Extension>(extension), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } bool ExtensionService::IsBeingUpgraded(const Extension* extension) { diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 127737f..b23dc47 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -59,7 +59,7 @@ #include "content/browser/in_process_webkit/dom_storage_context.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "googleurl/src/gurl.h" #include "net/base/cookie_monster.h" #include "net/base/cookie_options.h" @@ -485,11 +485,11 @@ class ExtensionServiceTest public: ExtensionServiceTest() : installed_(NULL) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } virtual void Observe(int type, @@ -3467,7 +3467,7 @@ class ExtensionsReadyRecorder : public content::NotificationObserver { public: ExtensionsReadyRecorder() : ready_(false) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } void set_ready(bool value) { ready_ = value; } diff --git a/chrome/browser/extensions/extension_settings_frontend_unittest.cc b/chrome/browser/extensions/extension_settings_frontend_unittest.cc index 2e3f1ab..076eda3 100644 --- a/chrome/browser/extensions/extension_settings_frontend_unittest.cc +++ b/chrome/browser/extensions/extension_settings_frontend_unittest.cc @@ -14,9 +14,6 @@ #include "chrome/browser/extensions/extension_settings_storage.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/testing_profile.h" -#include "content/common/notification_service.h" -#include "content/public/browser/notification_details.h" -#include "content/public/browser/notification_source.h" class ExtensionSettingsFrontendTest : public testing::Test { public: diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index 147c313..835d274 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -19,6 +19,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_service.h" #include "net/base/net_util.h" // This file contains high-level startup tests for the extensions system. We've @@ -92,7 +93,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { ui_test_utils::WindowedNotificationObserver user_scripts_observer( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); UserScriptMaster* master = browser()->profile()->GetUserScriptMaster(); if (!master->ScriptsReady()) user_scripts_observer.Wait(); @@ -169,7 +170,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) { if (service->AllowFileAccess(service->extensions()->at(i))) { ui_test_utils::WindowedNotificationObserver user_scripts_observer( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); service->SetAllowFileAccess(service->extensions()->at(i), false); user_scripts_observer.Wait(); } diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc index ad8c933..0b85716 100644 --- a/chrome/browser/extensions/extension_tab_helper.cc +++ b/chrome/browser/extensions/extension_tab_helper.cc @@ -22,7 +22,7 @@ #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" ExtensionTabHelper::ExtensionTabHelper(TabContentsWrapper* wrapper) : TabContentsObserver(wrapper->tab_contents()), @@ -55,10 +55,10 @@ void ExtensionTabHelper::SetExtensionApp(const Extension* extension) { UpdateExtensionAppIcon(extension_app_); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, content::Source<ExtensionTabHelper>(this), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } void ExtensionTabHelper::SetExtensionAppById( @@ -103,10 +103,10 @@ void ExtensionTabHelper::DidNavigateMainFramePostCommit( if (browser_action) { browser_action->ClearAllValuesForTab( wrapper_->restore_tab_helper()->session_id().id()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, content::Source<ExtensionAction>(browser_action), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } ExtensionAction* page_action = diff --git a/chrome/browser/extensions/extension_tab_id_map.cc b/chrome/browser/extensions/extension_tab_id_map.cc index 3f8286d..c07da6f 100644 --- a/chrome/browser/extensions/extension_tab_id_map.cc +++ b/chrome/browser/extensions/extension_tab_id_map.cc @@ -14,7 +14,7 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_observer.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" // @@ -41,11 +41,11 @@ class ExtensionTabIdMap::TabObserver : public content::NotificationObserver { ExtensionTabIdMap::TabObserver::TabObserver() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); } ExtensionTabIdMap::TabObserver::~TabObserver() { diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 7cc8f14..221fbf3 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -47,7 +47,8 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" #include "skia/ext/image_operations.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/extensions/extension_test_api.cc b/chrome/browser/extensions/extension_test_api.cc index a78707a..a8f85fc 100644 --- a/chrome/browser/extensions/extension_test_api.cc +++ b/chrome/browser/extensions/extension_test_api.cc @@ -13,7 +13,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" namespace { @@ -28,10 +28,10 @@ const char kNoTestConfigDataError[] = "Test configuration was not set."; ExtensionTestPassFunction::~ExtensionTestPassFunction() {} bool ExtensionTestPassFunction::RunImpl() { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_TEST_PASSED, content::Source<Profile>(dispatcher()->profile()), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); return true; } @@ -40,7 +40,7 @@ ExtensionTestFailFunction::~ExtensionTestFailFunction() {} bool ExtensionTestFailFunction::RunImpl() { std::string message; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_TEST_FAILED, content::Source<Profile>(dispatcher()->profile()), content::Details<std::string>(&message)); @@ -80,7 +80,7 @@ bool ExtensionTestSendMessageFunction::RunImpl() { std::string message; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message)); AddRef(); // balanced in Reply - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, content::Source<ExtensionTestSendMessageFunction>(this), content::Details<std::string>(&message)); diff --git a/chrome/browser/extensions/extension_test_message_listener.cc b/chrome/browser/extensions/extension_test_message_listener.cc index 42df2b0..545925e 100644 --- a/chrome/browser/extensions/extension_test_message_listener.cc +++ b/chrome/browser/extensions/extension_test_message_listener.cc @@ -7,7 +7,7 @@ #include "chrome/browser/extensions/extension_test_api.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" ExtensionTestMessageListener::ExtensionTestMessageListener( const std::string& expected_message, @@ -17,7 +17,7 @@ ExtensionTestMessageListener::ExtensionTestMessageListener( waiting_(false), will_reply_(will_reply) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ExtensionTestMessageListener::~ExtensionTestMessageListener() {} diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc index ef2d276..6f8c695 100644 --- a/chrome/browser/extensions/extension_toolbar_model.cc +++ b/chrome/browser/extensions/extension_toolbar_model.cc @@ -11,7 +11,8 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" ExtensionToolbarModel::ExtensionToolbarModel(ExtensionService* service) : service_(service), diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 29f7733..2294c1d 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -37,7 +37,7 @@ #include "chrome/common/extensions/extension_file_util.h" #include "chrome/common/pref_names.h" #include "content/browser/utility_process_host.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "crypto/sha2.h" #include "googleurl/src/gurl.h" @@ -1216,14 +1216,14 @@ void ExtensionUpdater::FetchUpdatedExtension(const std::string& id, } void ExtensionUpdater::NotifyStarted() { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } void ExtensionUpdater::NotifyUpdateFound(const std::string& extension_id) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, content::Source<Profile>(profile_), content::Details<const std::string>(&extension_id)); @@ -1231,10 +1231,10 @@ void ExtensionUpdater::NotifyUpdateFound(const std::string& extension_id) { void ExtensionUpdater::NotifyIfFinished() { if (in_progress_ids_.empty()) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UPDATING_FINISHED, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); VLOG(1) << "Sending EXTENSION_UPDATING_FINISHED"; } } diff --git a/chrome/browser/extensions/extension_warning_set.cc b/chrome/browser/extensions/extension_warning_set.cc index f84a5ca..bbe2da8 100644 --- a/chrome/browser/extensions/extension_warning_set.cc +++ b/chrome/browser/extensions/extension_warning_set.cc @@ -8,7 +8,7 @@ #include "chrome/browser/ui/global_error_service.h" #include "chrome/browser/ui/global_error_service_factory.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -126,10 +126,10 @@ void ExtensionWarningSet::SuppressBadgeForCurrentWarnings() { } void ExtensionWarningSet::NotifyWarningsChanged() { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_WARNING_CHANGED, content::Source<Profile>(profile_), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); } void ExtensionWarningSet::ActivateBadge() { diff --git a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc index 5476f68..bda21c73 100644 --- a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc +++ b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc @@ -10,7 +10,7 @@ #include "chrome/browser/internal_auth.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_details.h" #include "net/base/escape.h" @@ -84,7 +84,7 @@ bool WebSocketProxyPrivateGetPassportForTCPFunction::RunImpl() { delay_response = true; registrar_.Add( this, chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); chromeos::WebSocketProxyController::Initiate(); } @@ -136,7 +136,7 @@ bool WebSocketProxyPrivateGetURLForTCPFunction::RunImpl() { delay_response = true; registrar_.Add( this, chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); chromeos::WebSocketProxyController::Initiate(); } diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc index 0b453a7..0cc2d01 100644 --- a/chrome/browser/extensions/extension_webnavigation_api.cc +++ b/chrome/browser/extensions/extension_webnavigation_api.cc @@ -19,7 +19,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "net/base/net_errors.h" @@ -367,10 +367,10 @@ void ExtensionWebNavigationEventRouter::Init() { content::Source<content::BrowserContext>(profile_)); registrar_.Add(this, content::NOTIFICATION_TAB_ADDED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } } diff --git a/chrome/browser/extensions/extension_webrequest_apitest.cc b/chrome/browser/extensions/extension_webrequest_apitest.cc index c1c5d41..d77be88 100644 --- a/chrome/browser/extensions/extension_webrequest_apitest.cc +++ b/chrome/browser/extensions/extension_webrequest_apitest.cc @@ -9,7 +9,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/base/mock_host_resolver.h" namespace { @@ -19,7 +19,7 @@ class CancelLoginDialog : public content::NotificationObserver { CancelLoginDialog() { registrar_.Add(this, chrome::NOTIFICATION_AUTH_NEEDED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } virtual ~CancelLoginDialog() {} diff --git a/chrome/browser/extensions/extension_webstore_private_apitest.cc b/chrome/browser/extensions/extension_webstore_private_apitest.cc index beaa097..d7fbf65 100644 --- a/chrome/browser/extensions/extension_webstore_private_apitest.cc +++ b/chrome/browser/extensions/extension_webstore_private_apitest.cc @@ -16,7 +16,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" #include "net/base/mock_host_resolver.h" namespace { diff --git a/chrome/browser/extensions/external_policy_extension_loader.cc b/chrome/browser/extensions/external_policy_extension_loader.cc index 88872b9..def4fa5 100644 --- a/chrome/browser/extensions/external_policy_extension_loader.cc +++ b/chrome/browser/extensions/external_policy_extension_loader.cc @@ -12,7 +12,8 @@ #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" #include "googleurl/src/gurl.h" namespace { diff --git a/chrome/browser/extensions/image_loading_tracker.cc b/chrome/browser/extensions/image_loading_tracker.cc index 92965b2..d43ace0 100644 --- a/chrome/browser/extensions/image_loading_tracker.cc +++ b/chrome/browser/extensions/image_loading_tracker.cc @@ -10,7 +10,7 @@ #include "chrome/common/extensions/extension_resource.h" #include "content/browser/browser_thread.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "skia/ext/image_operations.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/image_decoder.h" @@ -123,7 +123,7 @@ ImageLoadingTracker::ImageLoadingTracker(Observer* observer) : observer_(observer), next_id_(0) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); } ImageLoadingTracker::~ImageLoadingTracker() { diff --git a/chrome/browser/extensions/image_loading_tracker_unittest.cc b/chrome/browser/extensions/image_loading_tracker_unittest.cc index b848204..6496dd2 100644 --- a/chrome/browser/extensions/image_loading_tracker_unittest.cc +++ b/chrome/browser/extensions/image_loading_tracker_unittest.cc @@ -12,7 +12,7 @@ #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/extensions/extension_resource.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/size.h" @@ -162,9 +162,9 @@ TEST_F(ImageLoadingTrackerTest, DeleteExtensionWhileWaitingForCache) { // Send out notification the extension was uninstalled. UnloadedExtensionInfo details(extension.get(), extension_misc::UNLOAD_REASON_UNINSTALL); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources(), + content::NotificationService::AllSources(), content::Details<UnloadedExtensionInfo>(&details)); // Chuck the extension, that way if anyone tries to access it we should crash diff --git a/chrome/browser/extensions/network_delay_listener.cc b/chrome/browser/extensions/network_delay_listener.cc index f35a1fe..b372c60 100644 --- a/chrome/browser/extensions/network_delay_listener.cc +++ b/chrome/browser/extensions/network_delay_listener.cc @@ -14,7 +14,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/url_request/url_request.h" NetworkDelayListener::NetworkDelayListener() @@ -24,11 +24,11 @@ NetworkDelayListener::NetworkDelayListener() CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, - NotificationService::AllSources()); + content::NotificationService::AllSources()); AddRef(); // Will be balanced in Cleanup(). } diff --git a/chrome/browser/extensions/network_delay_listener_unittest.cc b/chrome/browser/extensions/network_delay_listener_unittest.cc index cfae394..1223804 100644 --- a/chrome/browser/extensions/network_delay_listener_unittest.cc +++ b/chrome/browser/extensions/network_delay_listener_unittest.cc @@ -15,7 +15,7 @@ #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_queue.h" #include "content/browser/site_instance.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_test_util.h" @@ -134,7 +134,7 @@ class NetworkDelayListenerTest scoped_ptr<TestExtensionHost> background_host( new TestExtensionHost(extension, chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, content::Source<Profile>(profile_.get()), content::Details<ExtensionHost>(background_host.get())); @@ -164,7 +164,7 @@ TEST_F(NetworkDelayListenerTest, DelayAndLoad) { // We don't care about a loaded extension dialog. scoped_ptr<TestExtensionHost> dialog_host( new TestExtensionHost(extension1_, chrome::VIEW_TYPE_EXTENSION_DIALOG)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, content::Source<Profile>(profile_.get()), content::Details<ExtensionHost>(dialog_host.get())); diff --git a/chrome/browser/extensions/speech_input/extension_speech_input_api.cc b/chrome/browser/extensions/speech_input/extension_speech_input_api.cc index 33c5737..48cf173 100644 --- a/chrome/browser/extensions/speech_input/extension_speech_input_api.cc +++ b/chrome/browser/extensions/speech_input/extension_speech_input_api.cc @@ -10,6 +10,8 @@ #include "chrome/browser/extensions/speech_input/extension_speech_input_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" namespace constants = extension_speech_input_api_constants; diff --git a/chrome/browser/extensions/speech_input/extension_speech_input_api.h b/chrome/browser/extensions/speech_input/extension_speech_input_api.h index fffbc1b..c0b2318 100644 --- a/chrome/browser/extensions/speech_input/extension_speech_input_api.h +++ b/chrome/browser/extensions/speech_input/extension_speech_input_api.h @@ -7,7 +7,7 @@ #pragma once #include "chrome/browser/extensions/extension_function.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_observer.h" class ExtensionSpeechInputManager; diff --git a/chrome/browser/extensions/speech_input/extension_speech_input_manager.cc b/chrome/browser/extensions/speech_input/extension_speech_input_manager.cc index b67f276..a5a92a7 100644 --- a/chrome/browser/extensions/speech_input/extension_speech_input_manager.cc +++ b/chrome/browser/extensions/speech_input/extension_speech_input_manager.cc @@ -17,7 +17,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" using namespace speech_input; @@ -272,7 +272,7 @@ void ExtensionSpeechInputManager::DidStartReceivingAudioOnUIThread() { state_ = kRecording; VLOG(1) << "Sending start notification"; - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STARTED, content::Source<Profile>(profile_), content::Details<std::string>(&extension_id_in_use_)); @@ -405,7 +405,7 @@ void ExtensionSpeechInputManager::DispatchError( // Will set the error property in the ongoing extension function calls. ExtensionError details(extension_id, error); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_FAILED, content::Source<Profile>(profile_), content::Details<ExtensionError>(&details)); @@ -604,7 +604,7 @@ void ExtensionSpeechInputManager::StopSucceededOnUIThread() { std::string extension_id = extension_id_in_use_; ResetToIdleState(); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STOPPED, // Guarded by the state_ == kShutdown check. content::Source<Profile>(profile_), diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index e9832c6..e6a9373 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -13,7 +13,7 @@ #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_source.h" #include "grit/generated_resources.h" #include "grit/theme_resources_standard.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc index ff0a036c..db7610d 100644 --- a/chrome/browser/extensions/user_script_listener.cc +++ b/chrome/browser/extensions/user_script_listener.cc @@ -12,7 +12,7 @@ #include "chrome/common/extensions/url_pattern.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/url_request/url_request.h" struct UserScriptListener::ProfileData { @@ -32,13 +32,13 @@ UserScriptListener::UserScriptListener() CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); AddRef(); // Will be balanced in Cleanup(). } diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc index faf744b..3d88cc6 100644 --- a/chrome/browser/extensions/user_script_listener_unittest.cc +++ b/chrome/browser/extensions/user_script_listener_unittest.cc @@ -17,7 +17,7 @@ #include "content/browser/renderer_host/global_request_id.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_queue.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_test_util.h" @@ -157,10 +157,10 @@ TEST_F(UserScriptListenerTest, DelayAndUpdate) { scoped_ptr<TestURLRequest> request(StartTestRequest(&delegate, kMatchingUrl)); ASSERT_FALSE(request->is_pending()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kTestData, delegate.data_received()); } @@ -180,10 +180,10 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) { // listener that the user scripts have been updated. ASSERT_FALSE(request->is_pending()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kTestData, delegate.data_received()); } @@ -226,7 +226,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { "content_script_yahoo.json", &error); ASSERT_TRUE(extension.get()); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_LOADED, content::Source<Profile>(&profile2), content::Details<Extension>(extension.get())); @@ -237,19 +237,19 @@ TEST_F(UserScriptListenerTest, MultiProfile) { // When the first profile's user scripts are ready, the request should still // be blocked waiting for profile2. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); MessageLoop::current()->RunAllPending(); ASSERT_FALSE(request->is_pending()); EXPECT_TRUE(delegate.data_received().empty()); // After profile2 is ready, the request should proceed. - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(&profile2), - NotificationService::NoDetails()); + content::NotificationService::NoDetails()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kTestData, delegate.data_received()); } diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index f3c5be1..f28003d 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -25,7 +25,7 @@ #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/extensions/extension_set.h" #include "content/browser/renderer_host/render_process_host.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" // Helper function to parse greasesmonkey headers static bool GetDeclarationValue(const base::StringPiece& line, @@ -295,7 +295,7 @@ UserScriptMaster::UserScriptMaster(Profile* profile) registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, content::Source<Profile>(profile_)); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, - NotificationService::AllBrowserContextsAndSources()); + content::NotificationService::AllBrowserContextsAndSources()); } UserScriptMaster::~UserScriptMaster() { @@ -323,7 +323,7 @@ void UserScriptMaster::NewScriptsAvailable(base::SharedMemory* handle) { SendUpdate(i.GetCurrentValue(), handle); } - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_), content::Details<base::SharedMemory>(handle)); diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc index dfd2eee..0334a0c 100644 --- a/chrome/browser/extensions/user_script_master_unittest.cc +++ b/chrome/browser/extensions/user_script_master_unittest.cc @@ -16,7 +16,7 @@ #include "chrome/test/base/testing_profile.h" #include "content/browser/browser_thread.h" #include "content/public/browser/notification_registrar.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -44,7 +44,7 @@ class UserScriptMasterTest : public testing::Test, // Register for all user script notifications. registrar_.Add(this, chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, - NotificationService::AllSources()); + content::NotificationService::AllSources()); // UserScriptMaster posts tasks to the file thread so make the current // thread look like one. |