OLD | NEW |
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_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 } | 1450 } |
1451 | 1451 |
1452 void BookmarkBarGtk::OnParentSizeAllocate(GtkWidget* widget, | 1452 void BookmarkBarGtk::OnParentSizeAllocate(GtkWidget* widget, |
1453 GtkAllocation* allocation) { | 1453 GtkAllocation* allocation) { |
1454 // In detached mode, our layout depends on the size of the tab contents. | 1454 // In detached mode, our layout depends on the size of the tab contents. |
1455 // We get the size-allocate signal before the tab contents does, hence we | 1455 // We get the size-allocate signal before the tab contents does, hence we |
1456 // need to post a delayed task so we will paint correctly. Note that | 1456 // need to post a delayed task so we will paint correctly. Note that |
1457 // gtk_widget_queue_draw by itself does not work, despite that it claims to | 1457 // gtk_widget_queue_draw by itself does not work, despite that it claims to |
1458 // be asynchronous. | 1458 // be asynchronous. |
1459 if (bookmark_bar_state_ == BookmarkBar::DETACHED) { | 1459 if (bookmark_bar_state_ == BookmarkBar::DETACHED) { |
1460 MessageLoop::current()->PostTask( | 1460 base::MessageLoop::current()->PostTask( |
1461 FROM_HERE, | 1461 FROM_HERE, |
1462 base::Bind(&BookmarkBarGtk::PaintEventBox, weak_factory_.GetWeakPtr())); | 1462 base::Bind(&BookmarkBarGtk::PaintEventBox, weak_factory_.GetWeakPtr())); |
1463 } | 1463 } |
1464 } | 1464 } |
1465 | 1465 |
1466 void BookmarkBarGtk::OnThrobbingWidgetDestroy(GtkWidget* widget) { | 1466 void BookmarkBarGtk::OnThrobbingWidgetDestroy(GtkWidget* widget) { |
1467 SetThrobbingWidget(NULL); | 1467 SetThrobbingWidget(NULL); |
1468 } | 1468 } |
1469 | 1469 |
1470 void BookmarkBarGtk::ShowImportDialog() { | 1470 void BookmarkBarGtk::ShowImportDialog() { |
1471 chrome::ShowImportDialog(browser_); | 1471 chrome::ShowImportDialog(browser_); |
1472 } | 1472 } |
1473 | 1473 |
1474 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { | 1474 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { |
1475 GtkDestDefaults dest_defaults = | 1475 GtkDestDefaults dest_defaults = |
1476 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : | 1476 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : |
1477 GTK_DEST_DEFAULT_DROP; | 1477 GTK_DEST_DEFAULT_DROP; |
1478 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); | 1478 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); |
1479 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, | 1479 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, |
1480 NULL, 0, kDragAction); | 1480 NULL, 0, kDragAction); |
1481 ui::SetDestTargetList(overflow_button_, kDestTargetList); | 1481 ui::SetDestTargetList(overflow_button_, kDestTargetList); |
1482 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); | 1482 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); |
1483 } | 1483 } |
OLD | NEW |