OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/views/toolbar/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 Layout(); | 885 Layout(); |
886 SchedulePaint(); | 886 SchedulePaint(); |
887 } | 887 } |
888 | 888 |
889 bool BrowserActionsContainer::ShowExtensionActionPopup( | 889 bool BrowserActionsContainer::ShowExtensionActionPopup( |
890 const Extension* extension) { | 890 const Extension* extension) { |
891 return ShowPopupForExtension(extension, false, false); | 891 return ShowPopupForExtension(extension, false, false); |
892 } | 892 } |
893 | 893 |
894 void BrowserActionsContainer::ToolbarVisibleCountChanged() { | 894 void BrowserActionsContainer::ToolbarVisibleCountChanged() { |
| 895 int old_container_width = container_width_; |
895 SetContainerWidth(); | 896 SetContainerWidth(); |
| 897 if (old_container_width != container_width_) { |
| 898 SaveDesiredSizeAndAnimate(gfx::Tween::EASE_OUT, |
| 899 model_->GetVisibleIconCount()); |
| 900 } |
896 } | 901 } |
897 | 902 |
898 void BrowserActionsContainer::ToolbarHighlightModeChanged( | 903 void BrowserActionsContainer::ToolbarHighlightModeChanged( |
899 bool is_highlighting) { | 904 bool is_highlighting) { |
900 // The visual highlighting is done in OnPaint(). It's a bit of a pain that | 905 // The visual highlighting is done in OnPaint(). It's a bit of a pain that |
901 // we delete and recreate everything here, but that's how it's done in | 906 // we delete and recreate everything here, but that's how it's done in |
902 // BrowserActionMoved(), too. If we want to optimize it, we could move the | 907 // BrowserActionMoved(), too. If we want to optimize it, we could move the |
903 // existing icons, instead of deleting it all. | 908 // existing icons, instead of deleting it all. |
904 DeleteBrowserActionViews(); | 909 DeleteBrowserActionViews(); |
905 CreateBrowserActionViews(); | 910 CreateBrowserActionViews(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 | 1057 |
1053 for (BrowserActionViews::iterator iter = browser_action_views_.begin(); | 1058 for (BrowserActionViews::iterator iter = browser_action_views_.begin(); |
1054 iter != browser_action_views_.end(); ++iter) { | 1059 iter != browser_action_views_.end(); ++iter) { |
1055 BrowserActionView* view = (*iter); | 1060 BrowserActionView* view = (*iter); |
1056 if (view->extension() == extension) | 1061 if (view->extension() == extension) |
1057 return view->view_controller()->ExecuteAction( | 1062 return view->view_controller()->ExecuteAction( |
1058 ExtensionPopup::SHOW, grant_tab_permissions); | 1063 ExtensionPopup::SHOW, grant_tab_permissions); |
1059 } | 1064 } |
1060 return false; | 1065 return false; |
1061 } | 1066 } |
OLD | NEW |