Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 12680004: Remove chrome/ code to handle App Notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflicts. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 17675742b364ed099fd7676bb714c93663b8fa92..ebe016bf4b77bd44c193f0261048852e67ab0e0b 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -35,7 +35,6 @@
#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/api/runtime/runtime_api.h"
#include "chrome/browser/extensions/api/storage/settings_frontend.h"
-#include "chrome/browser/extensions/app_notification_manager.h"
#include "chrome/browser/extensions/app_sync_data.h"
#include "chrome/browser/extensions/browser_event_router.h"
#include "chrome/browser/extensions/component_loader.h"
@@ -349,8 +348,6 @@ ExtensionService::ExtensionService(Profile* profile,
ready_(false),
toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
menu_manager_(profile),
- app_notification_manager_(
- new extensions::AppNotificationManager(profile)),
event_routers_initialized_(false),
update_once_all_providers_are_ready_(false),
browser_terminating_(false),
@@ -408,8 +405,6 @@ ExtensionService::ExtensionService(Profile* profile,
profile->GetPrefs(),
g_browser_process->local_state()));
- app_notification_manager_->Init();
-
if (extensions_enabled_) {
CHECK(!ProfileManager::IsImportProcess(*command_line));
extensions::ExternalProviderImpl::CreateExternalProviders(
@@ -1402,8 +1397,6 @@ extensions::AppSyncData ExtensionService::GetAppSyncData(
extension,
IsExtensionEnabled(extension.id()),
IsIncognitoEnabled(extension.id()),
- extension_prefs_->GetAppNotificationClientId(extension.id()),
- extension_prefs_->IsAppNotificationDisabled(extension.id()),
extension_prefs_->extension_sorting()->GetAppLaunchOrdinal(
extension.id()),
extension_prefs_->extension_sorting()->GetPageOrdinal(extension.id()));
@@ -1462,8 +1455,6 @@ bool ExtensionService::ProcessExtensionSyncData(
bool ExtensionService::ProcessAppSyncData(
const extensions::AppSyncData& app_sync_data) {
const std::string& id = app_sync_data.id();
- const Extension* extension = GetInstalledExtension(id);
- bool extension_installed = (extension != NULL);
if (app_sync_data.app_launch_ordinal().IsValid() &&
app_sync_data.page_ordinal().IsValid()) {
@@ -1475,14 +1466,6 @@ bool ExtensionService::ProcessAppSyncData(
app_sync_data.page_ordinal());
}
- if (extension_installed) {
- if (app_sync_data.notifications_disabled() !=
- extension_prefs_->IsAppNotificationDisabled(id)) {
- extension_prefs_->SetAppNotificationDisabled(
- id, app_sync_data.notifications_disabled());
- }
- }
-
if (!ProcessExtensionSyncDataHelper(app_sync_data.extension_sync_data(),
syncer::APPS)) {
app_sync_bundle_.AddPendingApp(id, app_sync_data);
@@ -1643,38 +1626,6 @@ void ExtensionService::SetIsIncognitoEnabled(
SyncExtensionChangeIfNeeded(*extension);
}
-void ExtensionService::SetAppNotificationSetupDone(
- const std::string& extension_id,
- const std::string& oauth_client_id) {
- const Extension* extension = GetInstalledExtension(extension_id);
- // This method is called when the user sets up app notifications.
- // So it is not expected to be called until the extension is installed.
- if (!extension) {
- NOTREACHED();
- return;
- }
- extension_prefs_->SetAppNotificationClientId(extension_id, oauth_client_id);
- SyncExtensionChangeIfNeeded(*extension);
-}
-
-void ExtensionService::SetAppNotificationDisabled(
- const std::string& extension_id,
- bool value) {
- const Extension* extension = GetInstalledExtension(extension_id);
- // This method is called when the user enables/disables app notifications.
- // So it is not expected to be called until the extension is installed.
- if (!extension) {
- NOTREACHED();
- return;
- }
- if (value)
- UMA_HISTOGRAM_COUNTS("Apps.SetAppNotificationsDisabled", 1);
- else
- UMA_HISTOGRAM_COUNTS("Apps.SetAppNotificationsEnabled", 1);
- extension_prefs_->SetAppNotificationDisabled(extension_id, value);
- SyncExtensionChangeIfNeeded(*extension);
-}
-
bool ExtensionService::CanCrossIncognito(const Extension* extension) const {
// We allow the extension to see events and data from another profile iff it
// uses "spanning" behavior and it has incognito access. "split" mode
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698