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