| OLD | NEW |
| 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_bar_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/gfx/text_elider.h" | 9 #include "app/gfx/text_elider.h" |
| 10 #include "app/gtk_dnd_util.h" | 10 #include "app/gtk_dnd_util.h" |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 return rv; | 473 return rv; |
| 474 } | 474 } |
| 475 | 475 |
| 476 bool BookmarkBarGtk::IsAlwaysShown() { | 476 bool BookmarkBarGtk::IsAlwaysShown() { |
| 477 return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); | 477 return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void BookmarkBarGtk::AnimationProgressed(const Animation* animation) { | 480 void BookmarkBarGtk::AnimationProgressed(const Animation* animation) { |
| 481 DCHECK_EQ(animation, slide_animation_.get()); | 481 DCHECK_EQ(animation, slide_animation_.get()); |
| 482 | 482 |
| 483 gint height = animation->GetCurrentValue() * | 483 gint height = |
| 484 (kBookmarkBarHeight - kBookmarkBarMinimumHeight) + | 484 static_cast<gint>(animation->GetCurrentValue() * |
| 485 (kBookmarkBarHeight - kBookmarkBarMinimumHeight)) + |
| 485 kBookmarkBarMinimumHeight; | 486 kBookmarkBarMinimumHeight; |
| 486 gtk_widget_set_size_request(event_box_.get(), -1, height); | 487 gtk_widget_set_size_request(event_box_.get(), -1, height); |
| 487 } | 488 } |
| 488 | 489 |
| 489 void BookmarkBarGtk::AnimationEnded(const Animation* animation) { | 490 void BookmarkBarGtk::AnimationEnded(const Animation* animation) { |
| 490 DCHECK_EQ(animation, slide_animation_.get()); | 491 DCHECK_EQ(animation, slide_animation_.get()); |
| 491 | 492 |
| 492 if (!slide_animation_->IsShowing()) | 493 if (!slide_animation_->IsShowing()) |
| 493 gtk_widget_hide(bookmark_hbox_); | 494 gtk_widget_hide(bookmark_hbox_); |
| 494 } | 495 } |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 break; | 1026 break; |
| 1026 } | 1027 } |
| 1027 } | 1028 } |
| 1028 DCHECK_NE(button_idx, -1); | 1029 DCHECK_NE(button_idx, -1); |
| 1029 | 1030 |
| 1030 // Find the GtkWidget* for the actual target button. | 1031 // Find the GtkWidget* for the actual target button. |
| 1031 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1032 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1032 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1033 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1033 PopupForButton(folder_list[button_idx]); | 1034 PopupForButton(folder_list[button_idx]); |
| 1034 } | 1035 } |
| OLD | NEW |