diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-17 17:49:19 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-17 17:49:19 +0000 |
commit | b093cd0a781df58f829419f68ca5c2212d6b9998 (patch) | |
tree | c31f36a09b9aab9a321cfaacc17f6eb208e0f032 /chrome | |
parent | 861ea873f78143ac8beaa932729c92c0a5019872 (diff) | |
download | chromium_src-b093cd0a781df58f829419f68ca5c2212d6b9998.zip chromium_src-b093cd0a781df58f829419f68ca5c2212d6b9998.tar.gz chromium_src-b093cd0a781df58f829419f68ca5c2212d6b9998.tar.bz2 |
GTK: Add a link to flash settings from the clear browsing history dialog.
BUG=35183
TEST=none
Review URL: http://codereview.chromium.org/606070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc | 35 | ||||
-rw-r--r-- | chrome/browser/gtk/clear_browsing_data_dialog_gtk.h | 8 |
2 files changed, 41 insertions, 2 deletions
diff --git a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc index f972ae5..c450c46 100644 --- a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc +++ b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -6,7 +6,9 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "chrome/browser/browser.h" #include "chrome/browser/browsing_data_remover.h" +#include "chrome/browser/gtk/gtk_chrome_link_button.h" #include "chrome/browser/profile.h" #include "chrome/common/gtk_util.h" #include "chrome/common/pref_names.h" @@ -133,6 +135,29 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, // Add the combo/label time period box to the vertical layout. gtk_box_pack_start(GTK_BOX(vbox), combo_hbox, FALSE, FALSE, 0); + // Add widgets for the area below the accept buttons. + GtkWidget* flash_link = gtk_chrome_link_button_new( + l10n_util::GetStringUTF8(IDS_FLASH_STORAGE_SETTINGS).c_str()); + g_signal_connect(G_OBJECT(flash_link), "clicked", + G_CALLBACK(HandleOnFlashLinkClicked), this); + GtkWidget* flash_link_hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(flash_link_hbox), flash_link, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(content_area), flash_link_hbox, FALSE, FALSE, 0); + + GtkWidget* separator = gtk_hseparator_new(); + gtk_box_pack_end(GTK_BOX(content_area), separator, FALSE, FALSE, 0); + + // Make sure we can move things around. + DCHECK_EQ(GTK_DIALOG(dialog)->action_area->parent, content_area); + + // Now rearrange those because they're *above* the accept buttons...there's + // no way to place them in the correct position with gtk_box_pack_end() so + // manually move things into the correct order. + gtk_box_reorder_child(GTK_BOX(content_area), flash_link_hbox, -1); + gtk_box_reorder_child(GTK_BOX(content_area), separator, -1); + gtk_box_reorder_child(GTK_BOX(content_area), GTK_DIALOG(dialog)->action_area, + -1); + g_signal_connect(dialog, "response", G_CALLBACK(HandleOnResponseDialog), this); gtk_widget_show_all(dialog); @@ -205,3 +230,11 @@ void ClearBrowsingDataDialogGtk::OnDialogWidgetClicked(GtkWidget* widget) { gtk_combo_box_get_active(GTK_COMBO_BOX(widget))); } } + +void ClearBrowsingDataDialogGtk::OnFlashLinkClicked(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(l10n_util::GetStringUTF8(IDS_FLASH_STORAGE_URL)), + GURL(), NEW_WINDOW, PageTransition::LINK); +} diff --git a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.h b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.h index 46a3c73..896119e 100644 --- a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.h +++ b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -37,6 +37,12 @@ class ClearBrowsingDataDialogGtk { void OnDialogResponse(GtkWidget* widget, int response); void OnDialogWidgetClicked(GtkWidget* widget); + static void HandleOnFlashLinkClicked(GtkWidget* button, + ClearBrowsingDataDialogGtk* user_data) { + user_data->OnFlashLinkClicked(button); + } + void OnFlashLinkClicked(GtkWidget* widget); + // UI elements. GtkWidget* del_history_checkbox_; GtkWidget* del_downloads_checkbox_; |