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

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: Fix build issues. 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..fc33a016a4a7d28de67c85902f915a37105edda3 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,29 @@ 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_insert_page(GTK_NOTEBOOK(notebook_), permission_tab_contents,
+ label, TAB_ID_PERMISSIONS);
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_insert_page(GTK_NOTEBOOK(notebook_), connection_tab, label,
+ TAB_ID_CONNECTION);
- gtk_box_pack_start(GTK_BOX(contents_), notebook, FALSE, FALSE, 0);
+ DCHECK_EQ(gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)), NUM_TAB_IDS);
+
+ gtk_box_pack_start(GTK_BOX(contents_), notebook_, FALSE, FALSE, 0);
gtk_widget_show_all(contents_);
}
@@ -542,6 +546,12 @@ void WebsiteSettingsPopupGtk::SetPermissionInfo(
gtk_widget_show_all(permissions_section_contents_);
}
+void WebsiteSettingsPopupGtk::SetSelectedTab(TabId tab_id) {
+ DCHECK(notebook_);
+ 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