Index: chrome/browser/chrome_select_file_policy.h |
diff --git a/chrome/browser/chrome_select_file_policy.h b/chrome/browser/chrome_select_file_policy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c79a78a476a9db79c073a67a9065f9d32cf21e17 |
--- /dev/null |
+++ b/chrome/browser/chrome_select_file_policy.h |
@@ -0,0 +1,37 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROME_SELECT_FILE_POLICY_H_ |
+#define CHROME_BROWSER_CHROME_SELECT_FILE_POLICY_H_ |
+ |
+#include "base/callback_forward.h" |
+#include "base/compiler_specific.h" |
+#include "ui/base/dialogs/select_file_policy.h" |
+ |
+namespace content { |
+class WebContents; |
+} |
+ |
+// A chrome specific SelectFilePolicy that checks local_state(). |
+class ChromeSelectFilePolicy : public ui::SelectFilePolicy { |
sky
2012/06/26 00:07:18
If this extends a class in ui, shouldn't it live i
|
+ public: |
+ ChromeSelectFilePolicy(); |
+ virtual ~ChromeSelectFilePolicy(); |
+ |
+ // Overridden from ui::SelectFilePolicy: |
+ virtual bool CanOpenSelectFileDialog() OVERRIDE; |
+ |
+ // Creates a policy failure callback that displays an infobar on the |
+ // WebContents the call is originating from, i.e. where the InfoBar should |
+ // be shown in case file-selection dialogs are forbidden by policy, or NULL |
+ // if no InfoBar should be shown. |
+ static base::Closure DisplayInfobarCallback( |
+ content::WebContents* source_contents); |
+ |
+ private: |
+ // Implementation detail for DisplayInfobarCallback(). |
+ static void DisplayInfobarOrWarn(content::WebContents* source_contents); |
+}; |
sky
2012/06/26 00:07:18
DISALLOW_COPY_AND_ASSIGN
|
+ |
+#endif // CHROME_BROWSER_CHROME_SELECT_FILE_POLICY_H_ |