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

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

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « chrome/browser/gtk/bookmark_editor_gtk_unittest.cc ('k') | chrome/browser/gtk/dialogs_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 <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gtk_dnd_util.h" 10 #include "app/gtk_dnd_util.h"
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 if (id == IDS_BOOKMARK_MANAGER_IMPORT_MENU) { 1400 if (id == IDS_BOOKMARK_MANAGER_IMPORT_MENU) {
1401 // ImporterHost is ref counted and will delete itself when done. 1401 // ImporterHost is ref counted and will delete itself when done.
1402 ImporterHost* host = new ImporterHost(); 1402 ImporterHost* host = new ImporterHost();
1403 ProfileInfo profile_info; 1403 ProfileInfo profile_info;
1404 profile_info.browser_type = BOOKMARKS_HTML; 1404 profile_info.browser_type = BOOKMARKS_HTML;
1405 profile_info.source_path = path.ToWStringHack(); 1405 profile_info.source_path = path.ToWStringHack();
1406 StartImportingWithUI(GTK_WINDOW(window_), FAVORITES, host, 1406 StartImportingWithUI(GTK_WINDOW(window_), FAVORITES, host,
1407 profile_info, profile_, 1407 profile_info, profile_,
1408 new ImportObserverImpl(profile()), false); 1408 new ImportObserverImpl(profile()), false);
1409 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { 1409 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) {
1410 if (g_browser_process->io_thread()) { 1410 bookmark_html_writer::WriteBookmarks(model_, path);
1411 bookmark_html_writer::WriteBookmarks(
1412 g_browser_process->io_thread()->message_loop(), model_, path);
1413 }
1414 } else { 1411 } else {
1415 NOTREACHED(); 1412 NOTREACHED();
1416 } 1413 }
1417 } 1414 }
1418 1415
1419 // static 1416 // static
1420 gboolean BookmarkManagerGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, 1417 gboolean BookmarkManagerGtk::OnGtkAccelerator(GtkAccelGroup* accel_group,
1421 GObject* acceleratable, 1418 GObject* acceleratable,
1422 guint keyval, 1419 guint keyval,
1423 GdkModifierType modifier, 1420 GdkModifierType modifier,
1424 BookmarkManagerGtk* bookmark_manager) { 1421 BookmarkManagerGtk* bookmark_manager) {
1425 modifier = static_cast<GdkModifierType>( 1422 modifier = static_cast<GdkModifierType>(
1426 modifier & gtk_accelerator_get_default_mod_mask()); 1423 modifier & gtk_accelerator_get_default_mod_mask());
1427 // The only accelerator we have registered is ctrl+w, so any other value is a 1424 // The only accelerator we have registered is ctrl+w, so any other value is a
1428 // non-fatal error. 1425 // non-fatal error.
1429 DCHECK_EQ(keyval, static_cast<guint>(GDK_w)); 1426 DCHECK_EQ(keyval, static_cast<guint>(GDK_w));
1430 DCHECK_EQ(modifier, GDK_CONTROL_MASK); 1427 DCHECK_EQ(modifier, GDK_CONTROL_MASK);
1431 1428
1432 gtk_widget_destroy(bookmark_manager->window_); 1429 gtk_widget_destroy(bookmark_manager->window_);
1433 1430
1434 return TRUE; 1431 return TRUE;
1435 } 1432 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_editor_gtk_unittest.cc ('k') | chrome/browser/gtk/dialogs_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698