Index: chrome/common/chrome_utility_messages.h |
diff --git a/chrome/common/chrome_utility_messages.h b/chrome/common/chrome_utility_messages.h |
index 8eaaede78b53c8a8d0cf86195af0732836824d18..99af34bc5d0bdded6fd179289f3f82d93e354495 100644 |
--- a/chrome/common/chrome_utility_messages.h |
+++ b/chrome/common/chrome_utility_messages.h |
@@ -4,10 +4,16 @@ |
// Multiply-included message file, so no include guard. |
+#if defined(OS_WIN) |
+#include <Windows.h> |
+#endif // defined(OS_WIN) |
+ |
#include <string> |
+#include <tuple> |
#include <vector> |
#include "base/files/file_path.h" |
+#include "base/strings/string16.h" |
#include "base/values.h" |
#include "build/build_config.h" |
#include "ipc/ipc_message_macros.h" |
@@ -24,6 +30,13 @@ |
// Singly-included section for typedefs. |
#ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
#define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
+ |
+#if defined(OS_WIN) |
+// A vector of filters, each being a tuple containing a display string (i.e. |
+// "Text Files") and a filter pattern (i.e. "*.txt"). |
+typedef std::vector<std::tuple<base::string16, base::string16>> |
+ GetOpenFileNameFilter; |
+#endif // OS_WIN |
#endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
@@ -111,6 +124,18 @@ |
IPC_STRUCT_TRAITS_END() |
#endif // FULL_SAFE_BROWSING |
+#if defined(OS_WIN) |
+IPC_STRUCT_BEGIN(ChromeUtilityMsg_GetSaveFileName_Params) |
+ IPC_STRUCT_MEMBER(HWND, owner) |
+ IPC_STRUCT_MEMBER(DWORD, flags) |
+ IPC_STRUCT_MEMBER(GetOpenFileNameFilter, filters) |
+ IPC_STRUCT_MEMBER(int, one_based_filter_index) |
+ IPC_STRUCT_MEMBER(base::FilePath, suggested_filename) |
+ IPC_STRUCT_MEMBER(base::FilePath, initial_directory) |
+ IPC_STRUCT_MEMBER(base::string16, default_extension) |
+IPC_STRUCT_END() |
+#endif // OS_WIN |
+ |
//------------------------------------------------------------------------------ |
// Utility process messages: |
// These are messages from the browser to the utility process. |
@@ -155,6 +180,25 @@ |
#endif // defined(OS_MACOSX) |
#endif // defined(FULL_SAFE_BROWSING) |
+#if defined(OS_WIN) |
+// Instructs the utility process to invoke GetOpenFileName. |owner| is the |
+// parent of the modal dialog, |flags| are OFN_* flags. |filter| constrains the |
+// user's file choices. |initial_directory| and |filename| select the directory |
+// to be displayed and the file to be initially selected. |
+// |
+// Either ChromeUtilityHostMsg_GetOpenFileName_Failed or |
+// ChromeUtilityHostMsg_GetOpenFileName_Result will be returned when the |
+// operation completes whether due to error or user action. |
+IPC_MESSAGE_CONTROL5(ChromeUtilityMsg_GetOpenFileName, |
+ HWND /* owner */, |
+ DWORD /* flags */, |
+ GetOpenFileNameFilter /* filter */, |
+ base::FilePath /* initial_directory */, |
+ base::FilePath /* filename */) |
+IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetSaveFileName, |
+ ChromeUtilityMsg_GetSaveFileName_Params /* params */) |
+#endif // defined(OS_WIN) |
+ |
//------------------------------------------------------------------------------ |
// Utility process host messages: |
// These are messages from the utility process to the browser. |
@@ -189,3 +233,14 @@ |
safe_browsing::zip_analyzer::Results) |
#endif // defined(OS_MACOSX) |
#endif // defined(FULL_SAFE_BROWSING) |
+ |
+#if defined(OS_WIN) |
+IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_GetOpenFileName_Failed) |
+IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetOpenFileName_Result, |
+ base::FilePath /* directory */, |
+ std::vector<base::FilePath> /* filenames */) |
+IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_GetSaveFileName_Failed) |
+IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetSaveFileName_Result, |
+ base::FilePath /* path */, |
+ int /* one_based_filter_index */) |
+#endif // defined(OS_WIN) |