blob: 49272553c7c53a91bc79677884217881fd405653 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2012 The Chromium Authors
[email protected]6e1fcd12012-07-02 17:14:202// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_CHROME_SELECT_FILE_POLICY_H_
6#define CHROME_BROWSER_UI_CHROME_SELECT_FILE_POLICY_H_
7
Keishi Hattori0e45c022021-11-27 09:25:528#include "base/memory/raw_ptr.h"
[email protected]4344a3c2013-01-17 23:49:209#include "ui/shell_dialogs/select_file_policy.h"
[email protected]6e1fcd12012-07-02 17:14:2010
11namespace content {
12class WebContents;
13}
14
15// A chrome specific SelectFilePolicy that checks local_state(), and will
16// display an infobar on the weakly owned |source_contents|.
17class ChromeSelectFilePolicy : public ui::SelectFilePolicy {
18 public:
19 explicit ChromeSelectFilePolicy(content::WebContents* source_contents);
Peter Boström53c6c5952021-09-17 09:41:2620
21 ChromeSelectFilePolicy(const ChromeSelectFilePolicy&) = delete;
22 ChromeSelectFilePolicy& operator=(const ChromeSelectFilePolicy&) = delete;
23
dcheng5dd5ff62014-10-21 12:42:3824 ~ChromeSelectFilePolicy() override;
[email protected]6e1fcd12012-07-02 17:14:2025
26 // Overridden from ui::SelectFilePolicy:
dcheng5dd5ff62014-10-21 12:42:3827 bool CanOpenSelectFileDialog() override;
28 void SelectFileDenied() override;
[email protected]6e1fcd12012-07-02 17:14:2029
[email protected]f1e0be72012-08-23 21:35:0030 // Returns true if local state allows showing file pickers.
31 static bool FileSelectDialogsAllowed();
32
[email protected]6e1fcd12012-07-02 17:14:2033 private:
Pârise6361d02023-07-19 09:00:4334 raw_ptr<content::WebContents, AcrossTasksDanglingUntriaged> source_contents_;
[email protected]6e1fcd12012-07-02 17:14:2035};
36
37#endif // CHROME_BROWSER_UI_CHROME_SELECT_FILE_POLICY_H_