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

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc

Issue 10871049: Connect MediaFileSystemRegistry with MediaGalleriesPreferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win - use after free Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/intents/device_attached_intent_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index f5a40fffc331d2146b67953c4ee48973f32e7d12..e7e29279be0a37c90d8f51e747bb4c24ba0a609e 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -79,7 +79,7 @@ bool MediaGalleriesGetMediaFileSystemsFunction::RunImpl() {
} else if (interactive == "if_needed") {
std::vector<MediaFileSystemRegistry::MediaFSInfo> filesystems =
MediaFileSystemRegistry::GetInstance()->GetMediaFileSystemsForExtension(
- render_view_host()->GetProcess(), *GetExtension());
+ render_view_host(), GetExtension());
if (filesystems.empty())
ShowDialog();
else
@@ -98,7 +98,7 @@ bool MediaGalleriesGetMediaFileSystemsFunction::RunImpl() {
void MediaGalleriesGetMediaFileSystemsFunction::GetAndReturnGalleries() {
std::vector<MediaFileSystemRegistry::MediaFSInfo> filesystems =
MediaFileSystemRegistry::GetInstance()->GetMediaFileSystemsForExtension(
- render_view_host()->GetProcess(), *GetExtension());
+ render_view_host(), GetExtension());
ReturnGalleries(filesystems);
}
@@ -115,7 +115,7 @@ void MediaGalleriesGetMediaFileSystemsFunction::ReturnGalleries(
"name", Value::CreateStringValue(filesystems[i].name));
list->Append(dict_value);
- if (GetExtension()->HasAPIPermission(
+ if (!filesystems[i].path.empty() && GetExtension()->HasAPIPermission(
extensions::APIPermission::kMediaGalleriesRead)) {
content::ChildProcessSecurityPolicy* policy =
ChildProcessSecurityPolicy::GetInstance();
« no previous file with comments | « no previous file | chrome/browser/intents/device_attached_intent_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698