1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. 2 // Portions copyright (c) 2012 The Chromium Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 6 #ifndef CEF_LIBCEF_BROWSER_NATIVE_FILE_DIALOG_RUNNER_MAC_H_ 7 #define CEF_LIBCEF_BROWSER_NATIVE_FILE_DIALOG_RUNNER_MAC_H_ 8 #pragma once 9 10 #include "libcef/browser/file_dialog_runner.h" 11 12 #include "base/memory/weak_ptr.h" 13 14 @class NSView; 15 16 class CefFileDialogRunnerMac : public CefFileDialogRunner { 17 public: 18 CefFileDialogRunnerMac(); 19 20 // CefFileDialogRunner methods: 21 void Run(AlloyBrowserHostImpl* browser, 22 const FileChooserParams& params, 23 RunFileChooserCallback callback) override; 24 25 private: 26 static void RunOpenFileDialog( 27 base::WeakPtr<CefFileDialogRunnerMac> weak_this, 28 const CefFileDialogRunner::FileChooserParams& params, 29 NSView* view, 30 int filter_index); 31 static void RunSaveFileDialog( 32 base::WeakPtr<CefFileDialogRunnerMac> weak_this, 33 const CefFileDialogRunner::FileChooserParams& params, 34 NSView* view, 35 int filter_index); 36 37 CefFileDialogRunner::RunFileChooserCallback callback_; 38 base::WeakPtrFactory<CefFileDialogRunnerMac> weak_ptr_factory_; 39 }; 40 41 #endif // CEF_LIBCEF_BROWSER_NATIVE_FILE_DIALOG_RUNNER_MAC_H_ 42