| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_UTILITY_SHELL_HANDLER_WIN_H_ | 5 #ifndef CHROME_UTILITY_IPC_SHELL_HANDLER_WIN_H_ | 
| 6 #define CHROME_UTILITY_SHELL_HANDLER_WIN_H_ | 6 #define CHROME_UTILITY_IPC_SHELL_HANDLER_WIN_H_ | 
| 7 | 7 | 
| 8 #include <Windows.h> | 8 #include <Windows.h> | 
| 9 | 9 | 
| 10 #include <tuple> | 10 #include <tuple> | 
| 11 #include <vector> | 11 #include <vector> | 
| 12 | 12 | 
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" | 
| 14 #include "base/macros.h" | 14 #include "base/macros.h" | 
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" | 
| 16 #include "chrome/utility/utility_message_handler.h" | 16 #include "chrome/utility/utility_message_handler.h" | 
| 17 | 17 | 
| 18 namespace base { | 18 namespace base { | 
| 19 class FilePath; | 19 class FilePath; | 
| 20 }  // namespace base | 20 }  // namespace base | 
| 21 | 21 | 
| 22 using GetOpenFileNameFilter = | 22 using GetOpenFileNameFilter = | 
| 23     std::vector<std::tuple<base::string16, base::string16>>; | 23     std::vector<std::tuple<base::string16, base::string16>>; | 
| 24 | 24 | 
| 25 struct ChromeUtilityMsg_GetSaveFileName_Params; | 25 struct ChromeUtilityMsg_GetSaveFileName_Params; | 
| 26 | 26 | 
| 27 // Handles requests to execute shell operations. Used to protect the browser | 27 // Handles requests to execute shell operations. Used to protect the browser | 
| 28 // process from instability due to 3rd-party shell extensions. Must be invoked | 28 // process from instability due to 3rd-party shell extensions. Must be invoked | 
| 29 // in a non-sandboxed utility process. | 29 // in a non-sandboxed utility process. | 
| 30 class ShellHandler : public UtilityMessageHandler { | 30 // Note: This class is deprecated in favor of the Mojo version. | 
|  | 31 //       See chrome/common/shell_handler_win.mojom and | 
|  | 32 //       chrome/utility/shell_handler_impl_win.h | 
|  | 33 class IPCShellHandler : public UtilityMessageHandler { | 
| 31  public: | 34  public: | 
| 32   ShellHandler(); | 35   IPCShellHandler(); | 
| 33   ~ShellHandler() override; | 36   ~IPCShellHandler() override; | 
| 34 | 37 | 
| 35   // IPC::Listener implementation | 38   // IPC::Listener implementation | 
| 36   bool OnMessageReceived(const IPC::Message& message) override; | 39   bool OnMessageReceived(const IPC::Message& message) override; | 
| 37 | 40 | 
| 38  private: | 41  private: | 
| 39   void OnGetOpenFileName( | 42   void OnGetOpenFileName(HWND owner, | 
| 40     HWND owner, | 43                          DWORD flags, | 
| 41     DWORD flags, | 44                          const GetOpenFileNameFilter& filter, | 
| 42     const GetOpenFileNameFilter& filter, | 45                          const base::FilePath& initial_directory, | 
| 43     const base::FilePath& initial_directory, | 46                          const base::FilePath& filename); | 
| 44     const base::FilePath& filename); |  | 
| 45 | 47 | 
| 46   void OnGetSaveFileName(const ChromeUtilityMsg_GetSaveFileName_Params& params); | 48   void OnGetSaveFileName(const ChromeUtilityMsg_GetSaveFileName_Params& params); | 
| 47 | 49 | 
| 48   DISALLOW_COPY_AND_ASSIGN(ShellHandler); | 50   DISALLOW_COPY_AND_ASSIGN(IPCShellHandler); | 
| 49 }; | 51 }; | 
| 50 | 52 | 
| 51 #endif  // CHROME_UTILITY_SHELL_HANDLER_WIN_H_ | 53 #endif  // CHROME_UTILITY_IPC_SHELL_HANDLER_WIN_H_ | 
| OLD | NEW | 
|---|