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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 2 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/chromeos/drive/drive_file_system.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc
index 4e62f6bf24bb36853bbef8a3c2c94d1a82c110c4..2f8c242946811aabb3c3a3211069c0225675c03f 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -2181,21 +2181,14 @@ DriveFileSystemMetadata DriveFileSystem::GetMetadata() const {
return metadata;
}
-void DriveFileSystem::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+void DriveFileSystem::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(pref_name == prefs::kDisableDriveHostedFiles);
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- PrefService* pref_service = profile_->GetPrefs();
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kDisableDriveHostedFiles) {
- SetHideHostedDocuments(
- pref_service->GetBoolean(prefs::kDisableDriveHostedFiles));
- }
- } else {
- NOTREACHED();
- }
+ PrefService* pref_service = profile_->GetPrefs();
+ SetHideHostedDocuments(
+ pref_service->GetBoolean(prefs::kDisableDriveHostedFiles));
}
void DriveFileSystem::SetHideHostedDocuments(bool hide) {

Powered by Google App Engine
This is Rietveld 408576698