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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/gtk/bookmarks/bookmark_bubble_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 void BookmarkBubbleGtk::OnFolderChanged(GtkWidget* widget) { 226 void BookmarkBubbleGtk::OnFolderChanged(GtkWidget* widget) {
227 int index = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_)); 227 int index = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_));
228 if (index == folder_combo_model_->GetItemCount() - 1) { 228 if (index == folder_combo_model_->GetItemCount() - 1) {
229 content::RecordAction( 229 content::RecordAction(
230 UserMetricsAction("BookmarkBubble_EditFromCombobox")); 230 UserMetricsAction("BookmarkBubble_EditFromCombobox"));
231 // GTK doesn't handle having the combo box destroyed from the changed 231 // GTK doesn't handle having the combo box destroyed from the changed
232 // signal. Since showing the editor also closes the bubble, delay this 232 // signal. Since showing the editor also closes the bubble, delay this
233 // so that GTK can unwind. Specifically gtk_menu_shell_button_release 233 // so that GTK can unwind. Specifically gtk_menu_shell_button_release
234 // will run, and we need to keep the combo box alive until then. 234 // will run, and we need to keep the combo box alive until then.
235 MessageLoop::current()->PostTask( 235 base::MessageLoop::current()->PostTask(
236 FROM_HERE, 236 FROM_HERE,
237 base::Bind(&BookmarkBubbleGtk::ShowEditor, factory_.GetWeakPtr())); 237 base::Bind(&BookmarkBubbleGtk::ShowEditor, factory_.GetWeakPtr()));
238 } 238 }
239 } 239 }
240 240
241 void BookmarkBubbleGtk::OnEditClicked(GtkWidget* widget) { 241 void BookmarkBubbleGtk::OnEditClicked(GtkWidget* widget) {
242 content::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); 242 content::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
243 ShowEditor(); 243 ShowEditor();
244 } 244 }
245 245
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(folder_combo_), 337 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(folder_combo_),
338 IsSeparator, NULL, NULL); 338 IsSeparator, NULL, NULL);
339 g_object_unref(store); 339 g_object_unref(store);
340 340
341 GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); 341 GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
342 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(folder_combo_), renderer, TRUE); 342 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(folder_combo_), renderer, TRUE);
343 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(folder_combo_), renderer, 343 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(folder_combo_), renderer,
344 "text", COLUMN_NAME, 344 "text", COLUMN_NAME,
345 NULL); 345 NULL);
346 } 346 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698