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

Side by Side Diff: chrome/browser/gtk/options/content_settings_window_gtk.cc

Issue 1727012: GTK: Put options dialogs in a different window group. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/gtk/options/fonts_languages_window_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); 139 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL);
140 140
141 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this); 141 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);
142 } 142 }
143 143
144 ContentSettingsWindowGtk::~ContentSettingsWindowGtk() { 144 ContentSettingsWindowGtk::~ContentSettingsWindowGtk() {
145 } 145 }
146 146
147 void ContentSettingsWindowGtk::ShowContentSettingsTab( 147 void ContentSettingsWindowGtk::ShowContentSettingsTab(
148 ContentSettingsType page) { 148 ContentSettingsType page) {
149 if (Browser* b = BrowserList::GetLastActive()) {
150 gtk_util::CenterOverWindow(GTK_WINDOW(dialog_),
151 b->window()->GetNativeHandle());
152 }
153
154 // Bring options window to front if it already existed and isn't already 149 // Bring options window to front if it already existed and isn't already
155 // in front 150 // in front
156 gtk_window_present_with_time(GTK_WINDOW(dialog_), 151 gtk_window_present_with_time(GTK_WINDOW(dialog_),
157 gtk_get_current_event_time()); 152 gtk_get_current_event_time());
158 153
159 if (page == CONTENT_SETTINGS_TYPE_DEFAULT) { 154 if (page == CONTENT_SETTINGS_TYPE_DEFAULT) {
160 // Remember the last visited page from local state. 155 // Remember the last visited page from local state.
161 page = static_cast<ContentSettingsType>(last_selected_page_.GetValue()); 156 page = static_cast<ContentSettingsType>(last_selected_page_.GetValue());
162 if (page == CONTENT_SETTINGS_TYPE_DEFAULT) 157 if (page == CONTENT_SETTINGS_TYPE_DEFAULT)
163 page = CONTENT_SETTINGS_TYPE_COOKIES; 158 page = CONTENT_SETTINGS_TYPE_COOKIES;
(...skipping 12 matching lines...) Expand all
176 int index = page_num; 171 int index = page_num;
177 DCHECK(index > CONTENT_SETTINGS_TYPE_DEFAULT && 172 DCHECK(index > CONTENT_SETTINGS_TYPE_DEFAULT &&
178 index < CONTENT_SETTINGS_NUM_TYPES); 173 index < CONTENT_SETTINGS_NUM_TYPES);
179 last_selected_page_.SetValue(index); 174 last_selected_page_.SetValue(index);
180 } 175 }
181 176
182 void ContentSettingsWindowGtk::OnWindowDestroy(GtkWidget* widget) { 177 void ContentSettingsWindowGtk::OnWindowDestroy(GtkWidget* widget) {
183 settings_window = NULL; 178 settings_window = NULL;
184 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 179 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
185 } 180 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/options/fonts_languages_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698