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

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: Merge to head for commit Created 8 years, 1 month 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 94aedf8798e7ea20647b6127c4c4d800ead4d071..98cd149b5ff665f41bc21d5934c74348e2572543 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -2140,21 +2140,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) {
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.h ('k') | chrome/browser/chromeos/drive/drive_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698