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

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: 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 52c4832120d251c0c86a5291a44e7efb0b33c3df..9b87d6c5d0f40b724560a1154d39ee911ec768d6 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -2184,21 +2184,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);
Mattias Nissler (ping if slow) 2012/10/30 13:37:07 same comment regarding if() {} else NOTREACHED();
- 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