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

Unified Diff: chrome/browser/extensions/api/preferences_private/preferences_private_api.cc

Issue 1776373002: [Extensions] Remove unused parts of the preferencesPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really clean up prefs Created 4 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
Index: chrome/browser/extensions/api/preferences_private/preferences_private_api.cc
diff --git a/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc b/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc
deleted file mode 100644
index 82de6f7cf1db322b0d4985962b230a4acac9abe3..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/api/preferences_private/preferences_private_api.h"
-
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
-#include "chrome/common/extensions/api/preferences_private.h"
-#include "components/browser_sync/browser/profile_sync_service.h"
-#include "components/sync_driver/sync_prefs.h"
-
-namespace extensions {
-
-namespace GetSyncCategoriesWithoutPassphrase =
- api::preferences_private::GetSyncCategoriesWithoutPassphrase;
-
-PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::
-PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction() {}
-
-PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::
-~PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction() {}
-
-void
-PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::OnStateChanged() {
- ProfileSyncService* sync_service =
- ProfileSyncServiceFactory::GetForProfile(GetProfile());
- if (sync_service->IsSyncActive()) {
- sync_service->RemoveObserver(this);
- RunAsync();
- Release(); // Balanced in RunAsync().
- }
-}
-
-bool PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::RunAsync() {
- ProfileSyncService* sync_service =
- ProfileSyncServiceFactory::GetForProfile(GetProfile());
- if (!sync_service)
- return false;
- if (!sync_service->IsSyncActive()) {
- AddRef(); // Balanced in OnStateChanged().
- sync_service->AddObserver(this);
- return true;
- }
-
- syncer::ModelTypeSet result_set = syncer::UserSelectableTypes();
-
- // Only include categories that are synced.
- sync_driver::SyncPrefs sync_prefs(GetProfile()->GetPrefs());
- if (!sync_prefs.HasKeepEverythingSynced()) {
- result_set = syncer::Intersection(result_set,
- sync_service->GetPreferredDataTypes());
- }
- // Don't include encrypted categories.
- result_set = syncer::Difference(result_set,
- sync_service->GetEncryptedDataTypes());
-
- std::vector<std::string> categories;
- for (syncer::ModelTypeSet::Iterator it = result_set.First(); it.Good();
- it.Inc()) {
- categories.push_back(syncer::ModelTypeToString(it.Get()));
- }
-
- results_ = GetSyncCategoriesWithoutPassphrase::Results::Create(categories);
- SendResponse(true);
- return true;
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698