Index: content/browser/renderer_host/file_utilities_message_filter.cc |
diff --git a/content/browser/renderer_host/file_utilities_message_filter.cc b/content/browser/renderer_host/file_utilities_message_filter.cc |
index e72916cde00582316531f63c31951cc34c500f73..15ba12ee06a21fad2723d3c50bf80aaf6a210043 100644 |
--- a/content/browser/renderer_host/file_utilities_message_filter.cc |
+++ b/content/browser/renderer_host/file_utilities_message_filter.cc |
@@ -7,6 +7,8 @@ |
#include "base/file_util.h" |
#include "content/browser/child_process_security_policy_impl.h" |
#include "content/common/file_utilities_messages.h" |
+#include "content/public/browser/content_browser_client.h" |
+#include "content/public/common/content_client.h" |
jam
2012/05/02 18:15:00
nit: not needed per convention
Avi (use Gerrit)
2012/05/02 20:22:23
Done.
|
using content::BrowserThread; |
@@ -32,6 +34,7 @@ bool FileUtilitiesMessageFilter::OnMessageReceived(const IPC::Message& message, |
IPC_MESSAGE_HANDLER(FileUtilitiesMsg_GetFileModificationTime, |
OnGetFileModificationTime) |
IPC_MESSAGE_HANDLER(FileUtilitiesMsg_OpenFile, OnOpenFile) |
+ IPC_MESSAGE_HANDLER(FileUtilitiesMsg_RevealFolderInOS, OnRevealFolderInOS) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -107,3 +110,10 @@ void FileUtilitiesMessageFilter::OnOpenFile( |
*result = base::FileDescriptor(file_handle, true); |
#endif |
} |
+ |
+void FileUtilitiesMessageFilter::OnRevealFolderInOS(const FilePath& path) { |
+ // Only honor the request if appropriate persmissions are granted. |
+ if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(process_id_, |
+ path)) |
+ content::GetContentClient()->browser()->OpenItem(path); |
+} |