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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_preferences.cc

Issue 16910002: Destroy StorageMonitorCros before DBusServices (take 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/media_galleries/media_galleries_dialog_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/media_galleries/media_galleries_preferences.h" 5 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 base::Bind(&MediaGalleriesPreferences::OnPicasaDeviceID, 255 base::Bind(&MediaGalleriesPreferences::OnPicasaDeviceID,
256 weak_factory_.GetWeakPtr())); 256 weak_factory_.GetWeakPtr()));
257 #endif 257 #endif
258 258
259 InitFromPrefs(false /*no notification*/); 259 InitFromPrefs(false /*no notification*/);
260 260
261 StorageMonitor::GetInstance()->AddObserver(this); 261 StorageMonitor::GetInstance()->AddObserver(this);
262 } 262 }
263 263
264 MediaGalleriesPreferences::~MediaGalleriesPreferences() { 264 MediaGalleriesPreferences::~MediaGalleriesPreferences() {
265 StorageMonitor::GetInstance()->RemoveObserver(this); 265 if (StorageMonitor::GetInstance())
Greg Billock 2013/06/13 14:55:31 This should merge out now since it was in the othe
266 StorageMonitor::GetInstance()->RemoveObserver(this);
266 } 267 }
267 268
268 void MediaGalleriesPreferences::AddDefaultGalleriesIfFreshProfile() { 269 void MediaGalleriesPreferences::AddDefaultGalleriesIfFreshProfile() {
269 // Only add defaults the first time. 270 // Only add defaults the first time.
270 if (APIHasBeenUsed(profile_)) 271 if (APIHasBeenUsed(profile_))
271 return; 272 return;
272 273
273 // Fresh profile case. 274 // Fresh profile case.
274 const int kDirectoryKeys[] = { 275 const int kDirectoryKeys[] = {
275 DIR_USER_MUSIC, 276 DIR_USER_MUSIC,
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 return extension_prefs_for_testing_; 827 return extension_prefs_for_testing_;
827 return extensions::ExtensionPrefs::Get(profile_); 828 return extensions::ExtensionPrefs::Get(profile_);
828 } 829 }
829 830
830 void MediaGalleriesPreferences::SetExtensionPrefsForTesting( 831 void MediaGalleriesPreferences::SetExtensionPrefsForTesting(
831 extensions::ExtensionPrefs* extension_prefs) { 832 extensions::ExtensionPrefs* extension_prefs) {
832 extension_prefs_for_testing_ = extension_prefs; 833 extension_prefs_for_testing_ = extension_prefs;
833 } 834 }
834 835
835 } // namespace chrome 836 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/media_galleries/media_galleries_dialog_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698