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

Side by Side Diff: chrome/browser/gtk/bookmark_manager_gtk.cc

Issue 155518: Make GTK file dialog box modal for parent window, instead of for the entire... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_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) 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 BookmarkManagerGtk::~BookmarkManagerGtk() { 321 BookmarkManagerGtk::~BookmarkManagerGtk() {
322 SaveColumnConfiguration(); 322 SaveColumnConfiguration();
323 model_->RemoveObserver(this); 323 model_->RemoveObserver(this);
324 } 324 }
325 325
326 void BookmarkManagerGtk::InitWidgets() { 326 void BookmarkManagerGtk::InitWidgets() {
327 window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); 327 window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
328 gtk_window_set_title(GTK_WINDOW(window_), 328 gtk_window_set_title(GTK_WINDOW(window_),
329 l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_TITLE).c_str()); 329 l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_TITLE).c_str());
330 330
331 // Add this window to its own unique window group to allow for
332 // window-to-parent modality.
333 gtk_window_group_add_window(gtk_window_group_new(), GTK_WINDOW(window_));
334 g_object_unref(gtk_window_get_group(GTK_WINDOW(window_)));
335
331 // Set the default size of the bookmark manager. 336 // Set the default size of the bookmark manager.
332 // Windows has code to do this that uses ChromeFont; we could share it but 337 // Windows has code to do this that uses ChromeFont; we could share it but
333 // since we don't plan to use it elsewhere it's probably not worth the effort. 338 // since we don't plan to use it elsewhere it's probably not worth the effort.
334 PangoContext* context = gtk_widget_create_pango_context(window_); 339 PangoContext* context = gtk_widget_create_pango_context(window_);
335 PangoFontMetrics* metrics = 340 PangoFontMetrics* metrics =
336 pango_context_get_metrics(context, window_->style->font_desc, 341 pango_context_get_metrics(context, window_->style->font_desc,
337 pango_context_get_language(context)); 342 pango_context_get_language(context));
338 double chars = 0; 343 double chars = 0;
339 StringToDouble(WideToUTF8(l10n_util::GetString( 344 StringToDouble(WideToUTF8(l10n_util::GetString(
340 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS)), &chars); 345 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS)), &chars);
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { 1236 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) {
1232 if (g_browser_process->io_thread()) { 1237 if (g_browser_process->io_thread()) {
1233 bookmark_html_writer::WriteBookmarks( 1238 bookmark_html_writer::WriteBookmarks(
1234 g_browser_process->io_thread()->message_loop(), model_, 1239 g_browser_process->io_thread()->message_loop(), model_,
1235 path.ToWStringHack()); 1240 path.ToWStringHack());
1236 } 1241 }
1237 } else { 1242 } else {
1238 NOTREACHED(); 1243 NOTREACHED();
1239 } 1244 }
1240 } 1245 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698