OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/bookmark_manager_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_manager_gtk.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 BookmarkManagerGtk::~BookmarkManagerGtk() { | 316 BookmarkManagerGtk::~BookmarkManagerGtk() { |
317 SaveColumnConfiguration(); | 317 SaveColumnConfiguration(); |
318 model_->RemoveObserver(this); | 318 model_->RemoveObserver(this); |
319 } | 319 } |
320 | 320 |
321 void BookmarkManagerGtk::InitWidgets() { | 321 void BookmarkManagerGtk::InitWidgets() { |
322 window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 322 window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
323 gtk_window_set_title(GTK_WINDOW(window_), | 323 gtk_window_set_title(GTK_WINDOW(window_), |
324 l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_TITLE).c_str()); | 324 l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_TITLE).c_str()); |
325 | 325 |
| 326 // Add this window to its own unique window group to allow for |
| 327 // window-to-parent modality. |
| 328 gtk_window_group_add_window(gtk_window_group_new(), GTK_WINDOW(window_)); |
| 329 g_object_unref(gtk_window_get_group(GTK_WINDOW(window_))); |
| 330 |
326 // Set the default size of the bookmark manager. | 331 // Set the default size of the bookmark manager. |
327 int width, height; | 332 int width, height; |
328 gtk_util::GetWidgetSizeFromResources(window_, | 333 gtk_util::GetWidgetSizeFromResources(window_, |
329 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, | 334 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, |
330 IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, | 335 IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, |
331 &width, &height); | 336 &width, &height); |
332 gtk_window_set_default_size(GTK_WINDOW(window_), width, height); | 337 gtk_window_set_default_size(GTK_WINDOW(window_), width, height); |
333 | 338 |
334 // Build the organize and tools menus. | 339 // Build the organize and tools menus. |
335 organize_ = gtk_menu_item_new_with_label( | 340 organize_ = gtk_menu_item_new_with_label( |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { | 1216 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { |
1212 if (g_browser_process->io_thread()) { | 1217 if (g_browser_process->io_thread()) { |
1213 bookmark_html_writer::WriteBookmarks( | 1218 bookmark_html_writer::WriteBookmarks( |
1214 g_browser_process->io_thread()->message_loop(), model_, | 1219 g_browser_process->io_thread()->message_loop(), model_, |
1215 path.ToWStringHack()); | 1220 path.ToWStringHack()); |
1216 } | 1221 } |
1217 } else { | 1222 } else { |
1218 NOTREACHED(); | 1223 NOTREACHED(); |
1219 } | 1224 } |
1220 } | 1225 } |
OLD | NEW |