Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5377)

Unified Diff: chrome/browser/chrome_select_file_policy.h

Issue 10667026: Start consolidating cross-port file selection code into ui/base/dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698