| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 642 |
| 643 if (width == desired_width_) | 643 if (width == desired_width_) |
| 644 resize_animation_.Reset(); | 644 resize_animation_.Reset(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 void BrowserActionsToolbarGtk::AnimationEnded(const Animation* animation) { | 647 void BrowserActionsToolbarGtk::AnimationEnded(const Animation* animation) { |
| 648 gtk_widget_set_size_request(button_hbox_.get(), desired_width_, -1); | 648 gtk_widget_set_size_request(button_hbox_.get(), desired_width_, -1); |
| 649 UpdateChevronVisibility(); | 649 UpdateChevronVisibility(); |
| 650 } | 650 } |
| 651 | 651 |
| 652 bool BrowserActionsToolbarGtk::IsCommandIdChecked(int command_id) const { |
| 653 return false; |
| 654 } |
| 655 |
| 656 bool BrowserActionsToolbarGtk::IsCommandIdEnabled(int command_id) const { |
| 657 return true; |
| 658 } |
| 659 |
| 660 bool BrowserActionsToolbarGtk::GetAcceleratorForCommandId( |
| 661 int command_id, |
| 662 menus::Accelerator* accelerator) { |
| 663 return false; |
| 664 } |
| 665 |
| 652 void BrowserActionsToolbarGtk::ExecuteCommand(int command_id) { | 666 void BrowserActionsToolbarGtk::ExecuteCommand(int command_id) { |
| 653 const Extension* extension = model_->GetExtensionByIndex(command_id); | 667 const Extension* extension = model_->GetExtensionByIndex(command_id); |
| 654 ExtensionAction* browser_action = extension->browser_action(); | 668 ExtensionAction* browser_action = extension->browser_action(); |
| 655 | 669 |
| 656 int tab_id = GetCurrentTabId(); | 670 int tab_id = GetCurrentTabId(); |
| 657 if (tab_id < 0) { | 671 if (tab_id < 0) { |
| 658 NOTREACHED() << "No current tab."; | 672 NOTREACHED() << "No current tab."; |
| 659 return; | 673 return; |
| 660 } | 674 } |
| 661 | 675 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 } | 935 } |
| 922 | 936 |
| 923 it->second.get()->GetContextMenu()->PopupAsContext(event->time); | 937 it->second.get()->GetContextMenu()->PopupAsContext(event->time); |
| 924 return TRUE; | 938 return TRUE; |
| 925 } | 939 } |
| 926 | 940 |
| 927 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 941 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
| 928 if (!resize_animation_.is_animating()) | 942 if (!resize_animation_.is_animating()) |
| 929 UpdateChevronVisibility(); | 943 UpdateChevronVisibility(); |
| 930 } | 944 } |
| OLD | NEW |