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

Unified Diff: chrome/browser/media_galleries/media_galleries_permission_controller.cc

Issue 329643002: Media Galleries: Allow readding blacklisted iApps libraries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: narrow down folders which imply iphoto Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/media_galleries_permission_controller.cc
diff --git a/chrome/browser/media_galleries/media_galleries_permission_controller.cc b/chrome/browser/media_galleries/media_galleries_permission_controller.cc
index 77b1148ed0d933a1fd62fd64c1082db679d79adf..54f0a664cb6981a32a8df6e8083ee84e00c20353 100644
--- a/chrome/browser/media_galleries/media_galleries_permission_controller.cc
+++ b/chrome/browser/media_galleries/media_galleries_permission_controller.cc
@@ -287,10 +287,13 @@ void MediaGalleriesPermissionController::FileSelected(
const base::FilePath& path,
int /*index*/,
void* /*params*/) {
- extensions::file_system_api::SetLastChooseEntryDirectory(
- extensions::ExtensionPrefs::Get(GetProfile()),
- extension_->id(),
- path);
+ // |web_contents_| is NULL in tests.
+ if (web_contents_) {
vandebo (ex-Chrome) 2014/06/11 16:40:56 Is this needed? Why are the existing tests ok?
tommycli 2014/06/11 18:17:56 Test crashes when the controller calls GetProfile(
+ extensions::file_system_api::SetLastChooseEntryDirectory(
+ extensions::ExtensionPrefs::Get(GetProfile()),
+ extension_->id(),
+ path);
+ }
// Try to find it in the prefs.
MediaGalleryPrefInfo gallery;
@@ -321,8 +324,9 @@ void MediaGalleriesPermissionController::FileSelected(
}
// Lastly, if not found, add a new gallery to |new_galleries_|.
- DCHECK_EQ(kInvalidMediaGalleryPrefId, gallery.pref_id);
- gallery.pref_id = GetDialogId(kInvalidMediaGalleryPrefId);
+ // prefId == kInvalidMediaGalleryPrefId for completely new galleries.
+ // The old prefId is retained for blacklisted galleries.
+ gallery.pref_id = GetDialogId(gallery.pref_id);
new_galleries_[gallery.pref_id] = Entry(gallery, true);
dialog_->UpdateGalleries();
}

Powered by Google App Engine
This is Rietveld 408576698