diff options
author | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 21:10:00 +0000 |
---|---|---|
committer | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 21:10:00 +0000 |
commit | d9898919b7f2e479c84caa3ec6f214f2e10bdddb (patch) | |
tree | 485ae6bc95b819467b87a3266b745acf688886da /chrome/browser/ui/gtk/certificate_dialogs.cc | |
parent | 79d68c6ea3f0ee22789e04bcdcdf64841618f2c1 (diff) | |
download | chromium_src-d9898919b7f2e479c84caa3ec6f214f2e10bdddb.zip chromium_src-d9898919b7f2e479c84caa3ec6f214f2e10bdddb.tar.gz chromium_src-d9898919b7f2e479c84caa3ec6f214f2e10bdddb.tar.bz2 |
Policy to manage file selection dialogs.
Adds a policy to allow/disallow file selection dialogs from
wherever they can be launched (Save Link As, Import Bookmarks, etc.).
In case file selection dialogs are disallowed by policy a InfoBar informs
the user whenever he triggers a file selection dialog.
BUG=73174
TEST=Manually set the policy and check if the corresponding file selection are not shown and the InfoBar appears.
Review URL: http://codereview.chromium.org/6814011
Patch from Sandro Feuz <sfeuz@google.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/certificate_dialogs.cc')
-rw-r--r-- | chrome/browser/ui/gtk/certificate_dialogs.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/ui/gtk/certificate_dialogs.cc b/chrome/browser/ui/gtk/certificate_dialogs.cc index 6b6e19a..bd9cf29 100644 --- a/chrome/browser/ui/gtk/certificate_dialogs.cc +++ b/chrome/browser/ui/gtk/certificate_dialogs.cc @@ -73,7 +73,8 @@ std::string GetBase64String(net::X509Certificate::OSCertHandle cert) { class Exporter : public SelectFileDialog::Listener { public: - Exporter(gfx::NativeWindow parent, net::X509Certificate::OSCertHandle cert); + Exporter(TabContents* tab_contents, gfx::NativeWindow parent, + net::X509Certificate::OSCertHandle cert); ~Exporter(); // SelectFileDialog::Listener implemenation. @@ -87,7 +88,8 @@ class Exporter : public SelectFileDialog::Listener { net::X509Certificate::OSCertHandles cert_chain_list_; }; -Exporter::Exporter(gfx::NativeWindow parent, +Exporter::Exporter(TabContents* tab_contents, + gfx::NativeWindow parent, net::X509Certificate::OSCertHandle cert) : select_file_dialog_(SelectFileDialog::Create(this)) { x509_certificate_model::GetCertChainFromCert(cert, &cert_chain_list_); @@ -102,6 +104,7 @@ Exporter::Exporter(gfx::NativeWindow parent, ShowCertSelectFileDialog(select_file_dialog_.get(), SelectFileDialog::SELECT_SAVEAS_FILE, suggested_path, + tab_contents, parent, NULL); } @@ -153,6 +156,7 @@ void Exporter::FileSelectionCanceled(void* params) { void ShowCertSelectFileDialog(SelectFileDialog* select_file_dialog, SelectFileDialog::Type type, const FilePath& suggested_path, + TabContents* tab_contents, gfx::NativeWindow parent, void* params) { SelectFileDialog::FileTypeInfo file_type_info; @@ -178,11 +182,12 @@ void ShowCertSelectFileDialog(SelectFileDialog* select_file_dialog, select_file_dialog->SelectFile( type, string16(), suggested_path, &file_type_info, 1, - FILE_PATH_LITERAL("crt"), parent, - params); + FILE_PATH_LITERAL("crt"), tab_contents, + parent, params); } -void ShowCertExportDialog(gfx::NativeWindow parent, +void ShowCertExportDialog(TabContents* tab_contents, + gfx::NativeWindow parent, net::X509Certificate::OSCertHandle cert) { - new Exporter(parent, cert); + new Exporter(tab_contents, parent, cert); } |