[chromedriver] Make GetElementLocationInView return the top-left coordinate rather...
[chromium-blink-merge.git] / chrome / utility / shell_handler_win.h
blobfdbed1b7f2ecefa5b512bf58b46830ab8dc8b49a
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
3 // found in the LICENSE file.
5 #ifndef CHROME_UTILITY_SHELL_HANDLER_WIN_H_
6 #define CHROME_UTILITY_SHELL_HANDLER_WIN_H_
8 #include <Windows.h>
10 #include <vector>
12 #include "base/compiler_specific.h"
13 #include "base/macros.h"
14 #include "base/strings/string16.h"
15 #include "base/tuple.h"
16 #include "chrome/utility/utility_message_handler.h"
18 namespace base {
19 class FilePath;
20 } // namespace base
22 typedef std::vector<Tuple<base::string16, base::string16>>
23 GetOpenFileNameFilter;
25 struct ChromeUtilityMsg_GetSaveFileName_Params;
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
29 // in a non-sandboxed utility process.
30 class ShellHandler : public UtilityMessageHandler {
31 public:
32 ShellHandler();
33 virtual ~ShellHandler();
35 // IPC::Listener implementation
36 virtual bool OnMessageReceived(const IPC::Message& message) override;
38 private:
39 void OnOpenItemViaShell(const base::FilePath& full_path);
41 void OnGetOpenFileName(
42 HWND owner,
43 DWORD flags,
44 const GetOpenFileNameFilter& filter,
45 const base::FilePath& initial_directory,
46 const base::FilePath& filename);
48 void OnGetSaveFileName(const ChromeUtilityMsg_GetSaveFileName_Params& params);
50 DISALLOW_COPY_AND_ASSIGN(ShellHandler);
53 #endif // CHROME_UTILITY_SHELL_HANDLER_WIN_H_