| 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);
|
| +}
|
|
|