Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |