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

Unified Diff: chrome/browser/ui/chrome_select_file_policy.cc

Issue 10832330: disable [add folder] button for media galleries dialog if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/ui/chrome_select_file_policy.cc
diff --git a/chrome/browser/ui/chrome_select_file_policy.cc b/chrome/browser/ui/chrome_select_file_policy.cc
index 116b52a520f4fa2e3306d27d7c2102812ffe7749..b41f0600773b13b6595205d0a87bbadd6e7c867d 100644
--- a/chrome/browser/ui/chrome_select_file_policy.cc
+++ b/chrome/browser/ui/chrome_select_file_policy.cc
@@ -24,16 +24,7 @@ ChromeSelectFilePolicy::ChromeSelectFilePolicy(
ChromeSelectFilePolicy::~ChromeSelectFilePolicy() {}
bool ChromeSelectFilePolicy::CanOpenSelectFileDialog() {
- DCHECK(g_browser_process);
-
- // local_state() can return NULL for tests.
- if (!g_browser_process->local_state())
- return false;
-
- return !g_browser_process->local_state()->FindPreference(
- prefs::kAllowFileSelectionDialogs) ||
- g_browser_process->local_state()->GetBoolean(
- prefs::kAllowFileSelectionDialogs);
+ return FileSelectDialogsAllowed();
}
void ChromeSelectFilePolicy::SelectFileDenied() {
@@ -52,3 +43,17 @@ void ChromeSelectFilePolicy::SelectFileDenied() {
<< "is given to display the InfoBar.";
}
}
+
+// static
+bool ChromeSelectFilePolicy::FileSelectDialogsAllowed() {
+ DCHECK(g_browser_process);
+
+ // local_state() can return NULL for tests.
+ if (!g_browser_process->local_state())
+ return false;
+
+ return !g_browser_process->local_state()->FindPreference(
+ prefs::kAllowFileSelectionDialogs) ||
+ g_browser_process->local_state()->GetBoolean(
+ prefs::kAllowFileSelectionDialogs);
+}

Powered by Google App Engine
This is Rietveld 408576698