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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 AnimationProgressed(&slide_animation_); | 427 AnimationProgressed(&slide_animation_); |
428 } | 428 } |
429 | 429 |
430 if (model_ && model_->IsLoaded()) | 430 if (model_ && model_->IsLoaded()) |
431 UpdateOtherBookmarksVisibility(); | 431 UpdateOtherBookmarksVisibility(); |
432 | 432 |
433 // Hide out behind the findbar. This is rather fragile code, it could | 433 // Hide out behind the findbar. This is rather fragile code, it could |
434 // probably be improved. | 434 // probably be improved. |
435 if (bookmark_bar_state_ == BookmarkBar::DETACHED) { | 435 if (bookmark_bar_state_ == BookmarkBar::DETACHED) { |
436 if (theme_service_->UsingNativeTheme()) { | 436 if (theme_service_->UsingNativeTheme()) { |
437 if (gtk_widget_get_realized(event_box_->parent)) | 437 GtkWidget* parent = gtk_widget_get_parent(event_box_.get()); |
438 gdk_window_lower(event_box_->parent->window); | 438 if (gtk_widget_get_realized(parent)) |
| 439 gdk_window_lower(gtk_widget_get_window(parent)); |
439 if (gtk_widget_get_realized(event_box_.get())) | 440 if (gtk_widget_get_realized(event_box_.get())) |
440 gdk_window_lower(event_box_->window); | 441 gdk_window_lower(gtk_widget_get_window(event_box_.get())); |
441 } else { // Chromium theme mode. | 442 } else { // Chromium theme mode. |
442 if (gtk_widget_get_realized(paint_box_)) { | 443 if (gtk_widget_get_realized(paint_box_)) { |
443 gdk_window_lower(paint_box_->window); | 444 gdk_window_lower(gtk_widget_get_window(paint_box_)); |
444 // The event box won't stay below its children's GdkWindows unless we | 445 // The event box won't stay below its children's GdkWindows unless we |
445 // toggle the above-child property here. If the event box doesn't stay | 446 // toggle the above-child property here. If the event box doesn't stay |
446 // below its children then events will be routed to it rather than the | 447 // below its children then events will be routed to it rather than the |
447 // children. | 448 // children. |
448 gtk_event_box_set_above_child(GTK_EVENT_BOX(event_box_.get()), TRUE); | 449 gtk_event_box_set_above_child(GTK_EVENT_BOX(event_box_.get()), TRUE); |
449 gtk_event_box_set_above_child(GTK_EVENT_BOX(event_box_.get()), FALSE); | 450 gtk_event_box_set_above_child(GTK_EVENT_BOX(event_box_.get()), FALSE); |
450 } | 451 } |
451 } | 452 } |
452 } | 453 } |
453 | 454 |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { | 1442 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { |
1442 GtkDestDefaults dest_defaults = | 1443 GtkDestDefaults dest_defaults = |
1443 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : | 1444 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : |
1444 GTK_DEST_DEFAULT_DROP; | 1445 GTK_DEST_DEFAULT_DROP; |
1445 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); | 1446 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); |
1446 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, | 1447 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, |
1447 NULL, 0, kDragAction); | 1448 NULL, 0, kDragAction); |
1448 ui::SetDestTargetList(overflow_button_, kDestTargetList); | 1449 ui::SetDestTargetList(overflow_button_, kDestTargetList); |
1449 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); | 1450 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); |
1450 } | 1451 } |
OLD | NEW |