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

Unified Diff: chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc

Issue 10829452: Auto select the connection tab of the Website Settings UI in case of an https error or mixed content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add views specific parts. 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/gtk/website_settings/website_settings_popup_gtk.cc
diff --git a/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc b/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc
index 930f2d6a5e611bc42271a7323253af2f57438b10..7c9056afdf947e17ebc019a5eef4d9136ca27a91 100644
--- a/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc
+++ b/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc
@@ -216,6 +216,7 @@ WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk(
identity_contents_(NULL),
connection_contents_(NULL),
first_visit_contents_(NULL),
+ notebook_(NULL),
presenter_(NULL) {
BrowserWindowGtk* browser_window =
BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent);
@@ -313,26 +314,26 @@ void WebsiteSettingsPopupGtk::InitContents() {
FALSE, 0);
// Create tab container and add all tabs.
- GtkWidget* notebook = gtk_notebook_new();
+ notebook_ = gtk_notebook_new();
if (theme_service_->UsingNativeTheme())
- gtk_widget_modify_bg(notebook, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_bg(notebook_, GTK_STATE_NORMAL, NULL);
else
- gtk_widget_modify_bg(notebook, GTK_STATE_NORMAL, &kBackgroundColor);
+ gtk_widget_modify_bg(notebook_, GTK_STATE_NORMAL, &kBackgroundColor);
GtkWidget* label = theme_service_->BuildLabel(
l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TAB_LABEL_PERMISSIONS),
ui::kGdkBlack);
gtk_widget_show(label);
gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook), permission_tab_contents, label);
+ GTK_NOTEBOOK(notebook_), permission_tab_contents, label);
label = theme_service_->BuildLabel(
l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TAB_LABEL_CONNECTION),
ui::kGdkBlack);
gtk_widget_show(label);
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), connection_tab, label);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook_), connection_tab, label);
- gtk_box_pack_start(GTK_BOX(contents_), notebook, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(contents_), notebook_, FALSE, FALSE, 0);
gtk_widget_show_all(contents_);
}
@@ -542,6 +543,17 @@ void WebsiteSettingsPopupGtk::SetPermissionInfo(
gtk_widget_show_all(permissions_section_contents_);
}
+void WebsiteSettingsPopupGtk::SetSelectedTab(TabId tab_id) {
+ DCHECK(notebook_);
+ // The |TabID|s correspond to the indicies used by the notebook widget.
+ // Therefore |tab_id| can be used directly for setting the current page of
+ // the |notebook_|.
+ DCHECK_EQ(TAB_ID_PERMISSIONS, 0);
+ DCHECK_EQ(TAB_ID_CONNECTION, 1);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_),
+ static_cast<gint>(tab_id));
+}
+
void WebsiteSettingsPopupGtk::OnCookiesLinkClicked(GtkWidget* widget) {
new CollectedCookiesGtk(GTK_WINDOW(parent_),
tab_contents_);

Powered by Google App Engine
This is Rietveld 408576698