diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:51:58 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:51:58 +0000 |
commit | 484b2908dab59f530a1b9ab2894d44757352cf26 (patch) | |
tree | 32b6b4a4e329660a4e10c4ef78f03c3fdb053390 /chrome/browser/gtk/options | |
parent | 596a4268bf59a220e0f9abd8150dc94d20e0770c (diff) | |
download | chromium_src-484b2908dab59f530a1b9ab2894d44757352cf26.zip chromium_src-484b2908dab59f530a1b9ab2894d44757352cf26.tar.gz chromium_src-484b2908dab59f530a1b9ab2894d44757352cf26.tar.bz2 |
Add link to disable individual plug-ins in Plug-ins tab of Content Settings (Linux gtk part).
BUG=736
TEST=Go to Content Settings -> Plug-ins and click on "Disable individual plug-ins..."; should get browser window with chrome://plugins/.
Review URL: http://codereview.chromium.org/1303002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/options')
-rw-r--r-- | chrome/browser/gtk/options/content_filter_page_gtk.cc | 27 | ||||
-rw-r--r-- | chrome/browser/gtk/options/content_filter_page_gtk.h | 1 |
2 files changed, 27 insertions, 1 deletions
diff --git a/chrome/browser/gtk/options/content_filter_page_gtk.cc b/chrome/browser/gtk/options/content_filter_page_gtk.cc index df87034..a445aa1 100644 --- a/chrome/browser/gtk/options/content_filter_page_gtk.cc +++ b/chrome/browser/gtk/options/content_filter_page_gtk.cc @@ -5,12 +5,16 @@ #include "chrome/browser/gtk/options/content_filter_page_gtk.h" #include "app/l10n_util.h" -#include "chrome/browser/gtk/gtk_util.h" +#include "chrome/browser/browser.h" #include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/profile.h" +#include "chrome/browser/gtk/browser_window_gtk.h" +#include "chrome/browser/gtk/gtk_chrome_link_button.h" +#include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/gtk/options/content_exceptions_window_gtk.h" #include "chrome/browser/gtk/options/options_layout_gtk.h" #include "chrome/common/pref_names.h" +#include "chrome/common/url_constants.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -96,6 +100,18 @@ GtkWidget* ContentFilterPageGtk::InitGroup() { gtk_box_pack_start(GTK_BOX(hbox), exceptions_button, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + // Add the "Disable individual plug-ins..." link on the plug-ins page. + if (content_type_ == CONTENT_SETTINGS_TYPE_PLUGINS) { + GtkWidget* plugins_page_link = gtk_chrome_link_button_new( + l10n_util::GetStringUTF8(IDS_PLUGIN_SELECTIVE_DISABLE).c_str()); + g_signal_connect(G_OBJECT(plugins_page_link), "clicked", + G_CALLBACK(OnPluginsPageLinkClickedThunk), this); + + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), plugins_page_link, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + } + return vbox; } @@ -118,3 +134,12 @@ void ContentFilterPageGtk::OnExceptionsClicked(GtkWidget* button) { GTK_WINDOW(gtk_widget_get_toplevel(button)), settings_map, content_type_); } + +void ContentFilterPageGtk::OnPluginsPageLinkClicked(GtkWidget* button) { + // We open a new browser window so the Options dialog doesn't get lost + // behind other windows. + Browser* browser = Browser::Create(profile()); + browser->OpenURL(GURL(chrome::kChromeUIPluginsURL), + GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); + browser->window()->Show(); +} diff --git a/chrome/browser/gtk/options/content_filter_page_gtk.h b/chrome/browser/gtk/options/content_filter_page_gtk.h index fe562b4c..35822ac 100644 --- a/chrome/browser/gtk/options/content_filter_page_gtk.h +++ b/chrome/browser/gtk/options/content_filter_page_gtk.h @@ -31,6 +31,7 @@ class ContentFilterPageGtk : public OptionsPageBase { CHROMEGTK_CALLBACK_0(ContentFilterPageGtk, void, OnAllowToggled); CHROMEGTK_CALLBACK_0(ContentFilterPageGtk, void, OnExceptionsClicked); + CHROMEGTK_CALLBACK_0(ContentFilterPageGtk, void, OnPluginsPageLinkClicked); ContentSettingsType content_type_; |