| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 SetChevronState(); | 450 SetChevronState(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void BookmarkBarGtk::Hide(BookmarkBar::State old_state, | 453 void BookmarkBarGtk::Hide(BookmarkBar::State old_state, |
| 454 BookmarkBar::AnimateChangeType animate_type) { | 454 BookmarkBar::AnimateChangeType animate_type) { |
| 455 UpdateDetachedState(old_state); | 455 UpdateDetachedState(old_state); |
| 456 | 456 |
| 457 // After coming out of fullscreen, the browser window sets the bookmark bar | 457 // After coming out of fullscreen, the browser window sets the bookmark bar |
| 458 // to the "hidden" state, which means we need to show our minimum height. | 458 // to the "hidden" state, which means we need to show our minimum height. |
| 459 gtk_widget_show(widget()); | 459 if (!window_->IsFullscreen()) |
| 460 gtk_widget_show(widget()); |
| 460 CalculateMaxHeight(); | 461 CalculateMaxHeight(); |
| 461 // Sometimes we get called without a matching call to open. If that happens | 462 // Sometimes we get called without a matching call to open. If that happens |
| 462 // then force hide. | 463 // then force hide. |
| 463 if (slide_animation_.IsShowing() && | 464 if (slide_animation_.IsShowing() && |
| 464 animate_type == BookmarkBar::ANIMATE_STATE_CHANGE) { | 465 animate_type == BookmarkBar::ANIMATE_STATE_CHANGE) { |
| 465 slide_animation_.Hide(); | 466 slide_animation_.Hide(); |
| 466 } else { | 467 } else { |
| 467 gtk_widget_hide(bookmark_hbox_); | 468 gtk_widget_hide(bookmark_hbox_); |
| 468 slide_animation_.Reset(0); | 469 slide_animation_.Reset(0); |
| 469 AnimationProgressed(&slide_animation_); | 470 AnimationProgressed(&slide_animation_); |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { | 1425 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { |
| 1425 GtkDestDefaults dest_defaults = | 1426 GtkDestDefaults dest_defaults = |
| 1426 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : | 1427 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : |
| 1427 GTK_DEST_DEFAULT_DROP; | 1428 GTK_DEST_DEFAULT_DROP; |
| 1428 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); | 1429 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); |
| 1429 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, | 1430 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, |
| 1430 NULL, 0, kDragAction); | 1431 NULL, 0, kDragAction); |
| 1431 ui::SetDestTargetList(overflow_button_, kDestTargetList); | 1432 ui::SetDestTargetList(overflow_button_, kDestTargetList); |
| 1432 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); | 1433 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); |
| 1433 } | 1434 } |
| OLD | NEW |