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/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 index = model_->OriginalIndexToIncognito(index); | 770 index = model_->OriginalIndexToIncognito(index); |
771 | 771 |
772 gtk_box_reorder_child(GTK_BOX(button_hbox_.get()), button_widget, index); | 772 gtk_box_reorder_child(GTK_BOX(button_hbox_.get()), button_widget, index); |
773 } | 773 } |
774 | 774 |
775 void BrowserActionsToolbarGtk::ModelLoaded() { | 775 void BrowserActionsToolbarGtk::ModelLoaded() { |
776 SetContainerWidth(); | 776 SetContainerWidth(); |
777 } | 777 } |
778 | 778 |
779 void BrowserActionsToolbarGtk::AnimationProgressed( | 779 void BrowserActionsToolbarGtk::AnimationProgressed( |
780 const ui::Animation* animation) { | 780 const gfx::Animation* animation) { |
781 int width = start_width_ + (desired_width_ - start_width_) * | 781 int width = start_width_ + (desired_width_ - start_width_) * |
782 animation->GetCurrentValue(); | 782 animation->GetCurrentValue(); |
783 gtk_widget_set_size_request(button_hbox_.get(), width, -1); | 783 gtk_widget_set_size_request(button_hbox_.get(), width, -1); |
784 | 784 |
785 if (width == desired_width_) | 785 if (width == desired_width_) |
786 resize_animation_.Reset(); | 786 resize_animation_.Reset(); |
787 } | 787 } |
788 | 788 |
789 void BrowserActionsToolbarGtk::AnimationEnded(const ui::Animation* animation) { | 789 void BrowserActionsToolbarGtk::AnimationEnded(const gfx::Animation* animation) { |
790 gtk_widget_set_size_request(button_hbox_.get(), desired_width_, -1); | 790 gtk_widget_set_size_request(button_hbox_.get(), desired_width_, -1); |
791 UpdateChevronVisibility(); | 791 UpdateChevronVisibility(); |
792 } | 792 } |
793 | 793 |
794 bool BrowserActionsToolbarGtk::IsCommandIdChecked(int command_id) const { | 794 bool BrowserActionsToolbarGtk::IsCommandIdChecked(int command_id) const { |
795 return false; | 795 return false; |
796 } | 796 } |
797 | 797 |
798 bool BrowserActionsToolbarGtk::IsCommandIdEnabled(int command_id) const { | 798 bool BrowserActionsToolbarGtk::IsCommandIdEnabled(int command_id) const { |
799 const Extension* extension = model_->toolbar_items()[command_id].get(); | 799 const Extension* extension = model_->toolbar_items()[command_id].get(); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 | 1093 |
1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
1095 event->time); | 1095 event->time); |
1096 return TRUE; | 1096 return TRUE; |
1097 } | 1097 } |
1098 | 1098 |
1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
1100 if (!resize_animation_.is_animating()) | 1100 if (!resize_animation_.is_animating()) |
1101 UpdateChevronVisibility(); | 1101 UpdateChevronVisibility(); |
1102 } | 1102 } |
OLD | NEW |