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

Side by Side Diff: chrome/browser/ui/webui/options/media_galleries_handler.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/media_galleries_handler.h" 5 #include "chrome/browser/ui/webui/options/media_galleries_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "chrome/browser/media_gallery/media_file_system_registry.h" 9 #include "chrome/browser/media_gallery/media_file_system_registry.h"
10 #include "chrome/browser/media_gallery/media_galleries_preferences.h" 10 #include "chrome/browser/media_gallery/media_galleries_preferences.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 void MediaGalleriesHandler::FileSelected( 125 void MediaGalleriesHandler::FileSelected(
126 const FilePath& path, int index, void* params) { 126 const FilePath& path, int index, void* params) {
127 chrome::MediaGalleriesPreferences* prefs = 127 chrome::MediaGalleriesPreferences* prefs =
128 chrome::MediaFileSystemRegistry::GetInstance()->GetPreferences( 128 chrome::MediaFileSystemRegistry::GetInstance()->GetPreferences(
129 Profile::FromWebUI(web_ui())); 129 Profile::FromWebUI(web_ui()));
130 prefs->AddGalleryByPath(path); 130 prefs->AddGalleryByPath(path);
131 } 131 }
132 132
133 void MediaGalleriesHandler::Observe( 133 void MediaGalleriesHandler::OnPreferenceChanged(PrefServiceBase* service,
134 int type, 134 const std::string& pref_name) {
135 const content::NotificationSource& source, 135 DCHECK_EQ(std::string(prefs::kMediaGalleriesRememberedGalleries), pref_name);
136 const content::NotificationDetails& details) { 136 OnGalleriesChanged();
137 if (type == chrome::NOTIFICATION_PREF_CHANGED &&
138 *content::Details<std::string>(details).ptr() ==
139 prefs::kMediaGalleriesRememberedGalleries) {
140 OnGalleriesChanged();
141 } else {
142 NOTREACHED();
143 }
144 } 137 }
145 138
146 } // namespace options 139 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/media_galleries_handler.h ('k') | chrome/browser/ui/webui/options/password_manager_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698