| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/options/content_settings_window_gtk.h" | 5 #include "chrome/browser/gtk/options/content_settings_window_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 gtk_notebook_append_page( | 107 gtk_notebook_append_page( |
| 108 GTK_NOTEBOOK(notebook_), | 108 GTK_NOTEBOOK(notebook_), |
| 109 kNotebookPages[i].widget, | 109 kNotebookPages[i].widget, |
| 110 gtk_label_new((" " + label + " ").c_str())); | 110 gtk_label_new((" " + label + " ").c_str())); |
| 111 } | 111 } |
| 112 | 112 |
| 113 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook_), GTK_POS_LEFT); | 113 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook_), GTK_POS_LEFT); |
| 114 | 114 |
| 115 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); | 115 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); |
| 116 | 116 |
| 117 DCHECK_EQ(gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)), | 117 // TODO(thakis): Get rid of |+ 1| once the notifcations pane is done. |
| 118 DCHECK_EQ(gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)) + 1, |
| 118 CONTENT_SETTINGS_NUM_TYPES); | 119 CONTENT_SETTINGS_NUM_TYPES); |
| 119 | 120 |
| 120 // Need to show the notebook before connecting switch-page signal, otherwise | 121 // Need to show the notebook before connecting switch-page signal, otherwise |
| 121 // we'll immediately get a signal switching to page 0 and overwrite our | 122 // we'll immediately get a signal switching to page 0 and overwrite our |
| 122 // last_selected_page_ value. | 123 // last_selected_page_ value. |
| 123 gtk_util::ShowDialogWithLocalizedSize(dialog_, -1, -1, true); | 124 gtk_util::ShowDialogWithLocalizedSize(dialog_, -1, -1, true); |
| 124 | 125 |
| 125 g_signal_connect(notebook_, "switch-page", | 126 g_signal_connect(notebook_, "switch-page", |
| 126 G_CALLBACK(OnSwitchPageThunk), this); | 127 G_CALLBACK(OnSwitchPageThunk), this); |
| 127 | 128 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 int index = page_num; | 162 int index = page_num; |
| 162 DCHECK(index > CONTENT_SETTINGS_TYPE_DEFAULT && | 163 DCHECK(index > CONTENT_SETTINGS_TYPE_DEFAULT && |
| 163 index < CONTENT_SETTINGS_NUM_TYPES); | 164 index < CONTENT_SETTINGS_NUM_TYPES); |
| 164 last_selected_page_.SetValue(index); | 165 last_selected_page_.SetValue(index); |
| 165 } | 166 } |
| 166 | 167 |
| 167 void ContentSettingsWindowGtk::OnWindowDestroy(GtkWidget* widget) { | 168 void ContentSettingsWindowGtk::OnWindowDestroy(GtkWidget* widget) { |
| 168 settings_window = NULL; | 169 settings_window = NULL; |
| 169 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 170 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 170 } | 171 } |
| OLD | NEW |